<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 9, 2019 at 6:03 PM Bob Eastbrook <<a href="mailto:baconeater789@gmail.com">baconeater789@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Aug 5, 2019 at 1:36 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
<br>
> Does it work with gdb?<br>
<br>
It works with gdb.  More info:<br>
<br>
g++ & gdb -- works, even without debuginfo for libstdc++<br></blockquote><div><br>^ for std::string I'd expect this. For std::fstream, I expect you'd see the same problem/failure (gcc and clang both rely on fstream being homed in the standard library's debug info (because of vtables/key functions), but clang takes it a step further and does this for std::string too (because of template explicit instantiation decl/def))<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
clang++ & gdb -- works<br>
g++ & lldb -- works<br></blockquote><div><br>^ again, I expect that would fail with std::fstream, demonstrating that the same problem exists for both clang and GCC, just clang takes it a bit further - but it's not fundamentally different between the two.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
clang++ & lldb -- fails<br>
<br>
I now notice these warnings in lldb after installing the debuginfo packages:<br>
<br>
warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values:<br>
0x1f20 0x1f21<br>
warning: (x86_64) /lib64/libgcc_s.so.1 unsupported DW_FORM values: 0x1f20 0x1f21<br>
<br>
I searched the web for details on that error, but came up empty.<br>
Could it be that the debuginfo packages are just not compatible with<br>
lldb?<br></blockquote><div><br>Ooh, yeah, that's possible/likely. Unknown forms can't be ignored because forms dictate the encoding, so without recognizing the form, the DWARF can't be parsed (unknown /attributes/ using known forms are fine - because they can be parsed and the values ignored).<br><br>Yeah, looks like 1f20 (DW_FORM_GNU_ref_alt) and 1f21 (DW_FORM_GNU_strp_alt) are results of the 'dwz' tool that compacts DWARF debug info.<br><br>Not sure if it'd be enough to teach lldb how to parse but ignore any attribute using these forms - I would guess not, I suspect that would result in holes in the debug info where these forms are used. So you'd probably have to modify/fix/patch lldb to actually be able to understand these forms - which might not be too hard. Hmm, nope, probably fairly involved, since it means reading a new/different file (judging by this patch and the link to the DWARF standards proposal in it: <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150518/277186.html">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150518/277186.html</a> ).<br><br>Summary:<br>Yeah, short of making some relatively significant changes to lldb, I think you'll probably just have to stick with larger debug info by using -fstandalone-debug, since the debug info provided by your distribution uses GNU extensions that lldb doesn't currently support. :/<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> I'd try gdb + gcc + binutils ld (or gold) + libstdc++ (use std::fstream as an example of something that gcc will home to the libstdc++ debug info - dwarfdump your executable and you'll see it doesn't contain the definition of basic_fstream, but verify the debugger can still render the full definition). If that works, swap out various parts of that & see where it falls apart.<br>
<br>
Good strategy.  I don't quite have the hang of dwarfdump yet though,<br>
but I'll continue to investigate.<br>
</blockquote></div></div>