I don’t have much LLDB experience, but I’m trying to finally get it working in a visual debugger (VS Code at the moment). It seems like I should be able to look at a C++ string without much trouble. But…
(lldb) p name
(const std::string) $5 = Summary Unavailable
(lldb) po name
Summary Unavailable
(lldb) p *name.c_str()
(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >::value_type) $14 = '+'
Is there something wrong with my setup? Should those first two print something nice? (The actually string is just "+"
in this case.) I do have a custom built libc++, so the full namespace looks like: std::__myname::basic_string
. I don’t know if that’s a problem.
Typing p foo.c_str()
isn’t horrible, but in VS Code and I notice all strings in the “Variables” panel say “Summary Unavailable” and have a tree of gobblygook implementation details under them. I’d like it show the string’s value, of course.
▿ name: Summary Unavailable
▿ __r_ : { ... }
▿ std::__myname::__compressed_pair_elem<std::__myname...
▿ __value_ : { ... }
About six levels down in that I finally find something that appears to be the string’s expected value.