[lldb-dev] Navigating STL types

Andreas Yankopolus via lldb-dev lldb-dev at lists.llvm.org
Mon Jan 23 15:58:44 PST 2017


How can I navigate STL types using their overloaded operators and member functions (e.g., “[]” and “.first()” for vectors) ? For example, take a C++ source file with:

std::vector<std::string> v;
v.push_back("foo”);

Breaking after this statement in lldb and typing "p v[0]" would be reasonably expected to return "foo", but it gives a symbol lookup error. Similarly, “p v.first()” gives an error that there’s no member named “first”. I’m seeing this issue with clang/llvm 3.9 and 4.0 nightlies on Ubuntu 16.10 and with Apple’s versions on MacOS Sierra.

Internet rumor (e.g., this discussion <http://stackoverflow.com/questions/39680320/printing-debugging-libc-stl-with-xcode-lldb/39731933>) says this is aggressive inlining of STL code. I’m compiling in clang++ with “-O0 -g -glldb”.

In comparison, gdb prints the value of v[0] just fine when compiled with gdb.

What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170123/9588f4e3/attachment.html>


More information about the lldb-dev mailing list