]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Display entry offset for .debug_names
authorTom Tromey <tom@tromey.com>
Fri, 14 Feb 2025 00:47:23 +0000 (17:47 -0700)
committerTom Tromey <tom@tromey.com>
Tue, 4 Mar 2025 04:04:07 +0000 (21:04 -0700)
commitef8975b494c8c9bca73cda76c33244bb5fd1677f
treebc5e9d5f4041500cccf856bc3b62625b537b0499
parente578bccf57381f89a65a9cf733574e7f122e28aa
Display entry offset for .debug_names

Since commit ad6dde5aaae ("gdb/dwarf: write offset to parent entry for
DW_IDX_parent"), gdb now emits a .debug_names where the DW_IDX_parent
attribute refers to the parent entry's offset -- previously, due to
some confusion in the standard, gdb used the index of the parent's
name table entry.

This patch changes the .debug_names display code to display each
entry's offset.  This makes it easy to refer from a DW_IDX_parent to
the correct entry.

The new output looks like this:

[...]
Symbol table:
[  1] circular1: <0><1> DW_TAG_module DW_IDX_compile_unit=1 DW_IDX_die_offset=<0x19> DW_IDX_GNU_language=19
[...]
[  6] found: <0x28><2> DW_TAG_subprogram DW_IDX_compile_unit=1 DW_IDX_die_offset=<0x38> DW_IDX_GNU_language=19 DW_IDX_parent=<0x0>

Here you can see that DW_IDX_parent=0 refers to "circular1: <0>".
binutils/dwarf.c