Bug 27374

Summary: [dwz, dwarf5] .debug_names support
Product: dwz Reporter: Tom de Vries <vries>
Component: defaultAssignee: Nobody <nobody>
Status: NEW ---    
Severity: enhancement CC: dwz, mark, sam, tromey
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Bug Depends on: 24820    
Bug Blocks: 24726    

Description Tom de Vries 2021-02-08 13:07:39 UTC
Currently not supported:
...
$ gcc -gdwarf-5 ../src/testsuite/dwz.tests/hello.c 
$ gdb-add-index -dwarf-5 a.out
$ cp a.out 1; ./dwz 1
./dwz: 1: Unknown debugging section .debug_names
...
Comment 1 Mark Wielaard 2021-02-19 11:36:04 UTC
This will need coordination with the rest of the GNU Toolchain, in particular GDB, which uses .gdb_index (which dwz does support). The .debug_names that gdb-add-index -dwarf-5 generates seems incomplete (https://www.sourceware.org/bugzilla/show_bug.cgi?id=24820) and it might need some extensions (in DWARF6?) to be generated properly.
Comment 2 Tom Tromey 2024-02-09 19:58:50 UTC
FWIW I'd recommend simply making the index after running dwz.

However, if you really want to have dwz understand how to make
an index, you should be aware of gdb extensions:

https://sourceware.org/gdb/current/onlinedocs/gdb.html/Debug-Names.html#Debug-Names

There will be more of these, I think -- actually to handle
dwz we need some.

Also, gdb does producer-sniffing and rejects most indexes,
so probably it will also need a patch if dwz gains this capability.