Bug ID: 24820
Summary: .debug_names has incorrect contents
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---
gdb's "save gdb-index -dwarf-5" command creates a .debug_names index
that does not follow what I believe the DWARF standard specifies.
Then, gdb's .debug_names reader assumes that the index is gdb-like.
This is a problem for other readers and other writers; and anyway
gdb should follow the spec regardless.
First, it puts the mangled name into the index. From 22.214.171.124:
• If a subprogram or inlined subroutine is included, and has a
DW_AT_linkage_name attribute, there will be an additional index entry for
the linkage name.
Second, my understanding is that the index is intended to hold
simple names, essentially just the DW_AT_name; but gdb puts fully-qualified
names into the index instead. This does not seem to be spelled out
very explicitly in the DWARF standard, but it's what I recall from a
talk with Cary Coutant and Eric Christopher at a GCC Summit years ago.
Supporting evidence is what clang does (since this was based on some
earlier work by Apple) and also this text in 126.96.36.199:
The intent of the above rules is to provide the consumer with some assurance
up an unqualified name in the index will yield all relevant debugging
that provide a defining declaration at global scope for that name.
Note that it's fine for gdb to supplement the name list, though IMO
it would be better not to bother.
You are receiving this mail because:
You are on the CC list for the bug.