[3/3] Print the CU index in cooked_index::dump

Message ID 20240927-dwarf-incl-stuff-v1-3-cb925fa76af3@tromey.com
State New
Headers
Series Add more styling to some "maint" output |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed

Commit Message

Tom Tromey Sept. 27, 2024, 7:50 p.m. UTC
  While exploring a question I had about the DWARF indexer, I found I
wanted to see the CU index of each entry.  This patch adds this
information.
---
 gdb/dwarf2/cooked-index.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index cf67bb6cef3a41518a41421959bf6b16bab43df0..79dc2dbd9dc1f5867bbb508ad7ebb1a616bc5eb5 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -814,6 +814,7 @@  cooked_index::dump (gdbarch *arch)
       gdb_printf ("    DWARF tag:  %s\n", dwarf_tag_name (entry->tag));
       gdb_printf ("    flags:      %s\n", to_string (entry->flags).c_str ());
       gdb_printf ("    DIE offset: %s\n", sect_offset_str (entry->die_offset));
+      gdb_printf ("    CU index:   %u\n", entry->per_cu->index);
 
       if ((entry->flags & IS_PARENT_DEFERRED) != 0)
 	gdb_printf ("    parent:     deferred (%" PRIx64 ")\n",