public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/doc] Document .gdb_index and dwz interaction
@ 2023-09-12  9:58 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-09-12  9:58 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-12  9:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12  9:58 [PATCH] [gdb/doc] Document .gdb_index and dwz interaction Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).