GDB and debug fission

David Blaikie dblaikie@gmail.com
Fri Jan 8 02:17:08 GMT 2021


On Thu, Jan 7, 2021 at 5:48 PM Sterling Augustine via Gdb
<gdb@sourceware.org> wrote:
>
> On Thu, Jan 7, 2021 at 5:25 PM Alexander Yermolovich via Gdb
> <gdb@sourceware.org> wrote:
> >
> > Hello.
> >
> > For latest gdb to work with -gsplit-dwarf debug information generated by clang, either in split or single mode does it need gdb_index or pubnames?
> > In normal case where debug information is part of executable gdb_index is nice to speed up startup time, and I think I read pubnames is not used, but with debug fission are either gdb_index or pubnames necessary?
>
> For gdb to work with split-dwarf debug info, it needs a gdb_index.
> That can be generated in several ways. Gdb can build one itself--there
> is a script somewhere to add a gdb index.

Hmm, do you know if that ^ works with split DWARF? I assumed it
wouldn't (since I figured it was powered by the same logic that would
be used by gdb in the absence of an index). If that does work - we
could use that to reduce build overhead & just tell people "when you
want to debug, run this script, then use the debugger" (or build it
into the debugger, etc)

> But it is somewhat easier to have the linker you use generate
> gdb_index for you (both gnu-ld and llvm's lld can do this). They do
> this by reading the .gnu_pubnames section, so in some way, you need
> both pubnames *and* an index.
>
> So you would ordinarily use the following commands:
>
> $(CC) $(normal_arguments) -ggnu-pubnames
> $(LD)  $(normal_arguments) -Wl,--gdb-index


More information about the Gdb mailing list