<div dir="ltr">Worth noting that both gnu gold and gnu ld parse the debug info and generate entries for missing files. It is slower than one might want, but with --gdb-index on the command line, it seems like one would be willing to pay that cost.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 28, 2021 at 12:10 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@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"><div dir="ltr"><div dir="ltr">On Sat, Feb 27, 2021 at 6:20 PM Fangrui Song <<a href="mailto:maskray@google.com" target="_blank">maskray@google.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2021-02-27, Sterling Augustine wrote:<br>
>It's very common for some input files to have gnu-pubnames, and some not.<br>
>So the warning would have to be somewhat smart.<br>
<br>
I agree with Sterling that this can be very common:<br>
<br>
* system libraries compiled with -g but not -ggnu-pubnames<br>
* third-party libraries compiled with -g but not -ggnu-pubnames<br></blockquote><div><br>Sure, but the resultant broken gdb behavior is pretty problematic to experience without some notification.<br><br>If gdb-index had a way to say which CUs it covers (.debug_names has this, I believe), that'd be great - but without that, I think it's fundamentally invalid/incorrect to produce an incomplete gdb-index.<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 Sat, Feb 27, 2021 at 2:48 PM David Blaikie via llvm-dev <<br>
><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
>> I think the gdb-index support in lld only works with debug_gnu_pubnames in<br>
>> the input files - so you would need to compile with -ggnu-pubnames.<br>
>><br>
>> Maybe lld could/should have a warning or something if the input files have<br>
>> debug_* sections but don't have debug_gnu_pubnames when -Wl,--gdb-index is<br>
>> specified.<br>
<br>
The issue is <a href="https://bugs.llvm.org/show_bug.cgi?id=34820" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=34820</a><br>
We were hesistant on whether ld.lld should learn more DWARF stuff.<br></blockquote><div><br>I think it should be: either create a complete gdb-index, or error. Creating an incomplete gdb-index is/should be considered a fairly severe bug.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The problem is not that serious because it (`p &something` => $address, no debug<br>
info`) only affects objfiles which haven't been parsed by gdb (something like a<br>
lazy mode in gdb).  Once an objfile is loaded, everything works fine.<br></blockquote><div><br>I'd say this is pretty serious - unreliable operations lead to lack of confidence/pretty deep frustration with tools.</div></div></div>
</blockquote></div>