[PATCH] [gdb/doc] Document .gdb_index and dwz interaction

Tom de Vries tdevries@suse.de
Tue Sep 12 09:58:48 GMT 2023


Say we have an executable a.out, with a .gnu_debugaltlink to a dwz file a.dwz.

Adding a .gdb_index section to a.out also requires adding a minimal .gdb_index
section to a.dwz.

Our current implementation of gdb-add-index, based on the "save gdb-index"
command doesn't support this.  This is enhancement PR symtab/30841.

OTOH, our index cache does support this.

The minimal .gdb_index section in the dwz file consists of just a CU list.

In the symbol table in the executable we refer to CUs in the dwz file by
using an index pointing past the the CU and TU list in the executable.

This behaviour is currently undocumented, so add documentation for this:
...
Note that if there are type CUs and/or there's a dwz file, then conceptually
CUs, type CUs and dwz-CUs form a single list for the purposes of CU indices.
...

Build on x86_64-linux.
---
 gdb/doc/gdb.texinfo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9b7e06f3156..6548fec7112 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -49311,9 +49311,9 @@ values, sorted by the CU offset.  The first element in each pair is
 the offset of a CU in the @code{.debug_info} section.  The second
 element in each pair is the length of that CU.  References to a CU
 elsewhere in the map are done using a CU index, which is just the
-0-based index into this table.  Note that if there are type CUs, then
-conceptually CUs and type CUs form a single list for the purposes of
-CU indices.
+0-based index into this table.  Note that if there are type CUs and/or
+there's a dwz file, then conceptually CUs, type CUs and dwz-CUs form a
+single list for the purposes of CU indices.
 
 @item
 The types CU list.  This is a sequence of triplets of 64-bit

base-commit: aa240fbd480651bd72b3cebe7b5ea1cda204b7e9
-- 
2.35.3



More information about the Gdb-patches mailing list