I have been getting up to speed on the LLDB project and have been working towards getting all unit tests to pass on Linux. As part of this I have been working on a failure in the expression parsing when trying to evaluate std::string::c_str() function call. The failure is due to a mismatch in the name mangling between what is mangled in the LLDB runtime vs the inferior process exported symbols.
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.getAsType(), "char_traits"))
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:
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.