[llvm-dev] Some questions about lld with gdb-index option

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 28 12:10:03 PST 2021


On Sat, Feb 27, 2021 at 6:20 PM Fangrui Song <maskray at google.com> wrote:

> On 2021-02-27, Sterling Augustine wrote:
> >It's very common for some input files to have gnu-pubnames, and some not.
> >So the warning would have to be somewhat smart.
>
> I agree with Sterling that this can be very common:
>
> * system libraries compiled with -g but not -ggnu-pubnames
> * third-party libraries compiled with -g but not -ggnu-pubnames
>

Sure, but the resultant broken gdb behavior is pretty problematic to
experience without some notification.

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.


> >On Sat, Feb 27, 2021 at 2:48 PM David Blaikie via llvm-dev <
> >llvm-dev at lists.llvm.org> wrote:
> >
> >> I think the gdb-index support in lld only works with debug_gnu_pubnames
> in
> >> the input files - so you would need to compile with -ggnu-pubnames.
> >>
> >> Maybe lld could/should have a warning or something if the input files
> have
> >> debug_* sections but don't have debug_gnu_pubnames when -Wl,--gdb-index
> is
> >> specified.
>
> The issue is https://bugs.llvm.org/show_bug.cgi?id=34820
> We were hesistant on whether ld.lld should learn more DWARF stuff.
>

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.


> The problem is not that serious because it (`p &something` => $address, no
> debug
> info`) only affects objfiles which haven't been parsed by gdb (something
> like a
> lazy mode in gdb).  Once an objfile is loaded, everything works fine.
>

I'd say this is pretty serious - unreliable operations lead to lack of
confidence/pretty deep frustration with tools.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210228/5c217fb1/attachment.html>


More information about the llvm-dev mailing list