[gdb/doc] Document .gdb_index and dwz interaction

Message ID 20230912095848.12589-1-tdevries@suse.de
State New
Headers
Series [gdb/doc] Document .gdb_index and dwz interaction |

Checks

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

Commit Message

Tom de Vries Sept. 12, 2023, 9:58 a.m. UTC
  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(-)


base-commit: aa240fbd480651bd72b3cebe7b5ea1cda204b7e9
  

Patch

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