[lldb-dev] std::string name mangling
jingham at apple.com
jingham at apple.com
Thu Jul 3 14:24:45 PDT 2014
The llvm-dev mailing list might be a better place to ask this question.
Jim
> On Jul 3, 2014, at 1:06 PM, Alex Pepper <apepper at blueshiftinc.com> wrote:
>
> I have been debugging LLDB trying to find where the name mangling is getting messed up during eval parsing of std::string::c_str() and have traced it into CXXNameMangler::mangleStandardSubstitution in ItaniumMangle.cpp which is part of clangs AST module. In mangleStandardSubstitution it is testing the identifier to see if it is a ClassTemplateSpecializationDecl equivalent to std::basic_string<char,std::char_traits<char>,std::allocator<char>> so that it can substitute the short form mangled string "Ss". This check fails on the second template argument test where it is checking if it is a char specialization of char_traits.
>
> if (!isCharSpecialization(TemplateArgs[1].getAsType(), "char_traits"))
> return false;
>
> I have dumped the declaration to verify it is the correct identifier:
> class basic_string definition
> |-TemplateArgument type 'char'
> |-TemplateArgument type 'struct std::char_traits<char>'
> |-TemplateArgument type 'class std::allocator<char>'
>
> I also dumped the template arguments separately:
> char identifier
> struct std::char_traits<char> identifier
> class std::allocator<char> identifier
>
> I am not familiar enough yet with the Clang architecture to understand why this check is failing. Any suggestions on how to track this down would be appreciated.
>
> - Alex
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
More information about the lldb-dev
mailing list