We have a summary provider for std::string that is built into LLDB that must not be working with the C++ runtime you are using. The current summary string that is used is in source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp in LoadLibStdcppFormatters:
lldb::TypeSummaryImplSP std_string_summary_sp( new StringSummaryFormat(stl_summary_flags, “${var._M_dataplus._M_p}”));
So do a “frame var --raw msg” and see what the members of your std::string look like. I am guessing you won’t see “_M_dataplus” or “_M_p” in there. The “${var” means your std::string variable, and we are trying to access “msg._M_dataplus._M_p” to see what the string looks like.
Sounds like the compiler omitted the type info for std::string. Try "-glldb" in your compiler flags. This tunes debug info for LLDB. A lot of compilers will try to omit types from debug info if the type doesn't originate in the current executable. std::string would be one of those classes. If that flag doesn't work, then you might try -fno-limit-debug-info.
Thanks, Greg. Using "-g -fno-limit-debug-info" did the trick. All
works as expected now. Apparently the versions which ship with Ubuntu
19.04 and Fedora 30 differ with respect to this flag.
Sounds like the compiler omitted the type info for std::string. Try "-glldb" in your compiler flags. This tunes debug info for LLDB. A lot of compilers will try to omit types from debug info if the type doesn't originate in the current executable. std::string would be one of those classes. If that flag doesn't work, then you might try -fno-limit-debug-info.
Thanks, Greg. Using "-g -fno-limit-debug-info" did the trick. All works as expected now.
Great! Glad I could help.
Apparently the versions which ship with Ubuntu 19.04 and Fedora 30 differ with respect to this flag.
So are you saying "-glldb" is wrong on Fedora but "-fno-limit-debug-info" works?