[lldb-dev] LLDB Expression Parser Name Mangling

Greg Clayton gclayton at apple.com
Mon Jun 30 13:14:58 PDT 2014


> On Jun 30, 2014, at 12:33 PM, Zachary Turner <zturner at google.com> wrote:
> 
> Questions from a random observer: Why are these two manglings of std::string hardcoded into the code?

Because the compiler will emit one or both and the current libstdc++ only has one mangling in the symbol table. If we don't pull this trick we can end up not finding functions that are required in JITed code when the lookups for these symbols happen in the MCJIT.

>  Or better yet, why is std::string even special cased to begin with?  

Because this one of the few things that there are special aliased mangled names for in the mangling. Not sure why the compiler isn't always forced to use the shorter built in mangling, but it currently isn't. This might only be an issue on MacOSX, I am not sure on how often these issues would present themselves on other systems.

> Is the debug visualization support not sufficient to be able to deal with stl strings in a useful manner?

Debug visualization is just fine, it is just when the MCJIT says "I must get an address for this mangled named" and if we aren't able to find it, the expression evaluation fails.

Greg



More information about the lldb-dev mailing list