From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 545793858D3C for ; Tue, 12 Sep 2023 09:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 545793858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8E30721836 for ; Tue, 12 Sep 2023 09:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694512740; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1FrclGDcUJ1xXHokNWzvoa4zbJgMgKKnXt3Tf2g8kg4=; b=djcDy9kAeIcSP7SRarWRAdJPJjT6DQhJv3ehG5x+DGOwdrxuvXvKJIjE4CFZo/8ZhqpxSC uigLD73ke4KGAXXNx0bcoW2Oy2YK62O1JnuB2gmEhxQuRJ8TaWzgTZ4BXTg/3GBa1+WpFy rI5HoVFdWWmesV9RQedS+qdosoA8W7A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694512740; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1FrclGDcUJ1xXHokNWzvoa4zbJgMgKKnXt3Tf2g8kg4=; b=NGi7ExQpxwpMDPVCMejHsubxmtBHuiDAhdZxgtdApt1oSrJ/+95sCpGtcp66Xmm8CgSHvu m03PtOSFTcvXMkDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 798F913A39 for ; Tue, 12 Sep 2023 09:59:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VcuQHGQ2AGUvRwAAMHmgww (envelope-from ) for ; Tue, 12 Sep 2023 09:59:00 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/doc] Document .gdb_index and dwz interaction Date: Tue, 12 Sep 2023 11:58:48 +0200 Message-Id: <20230912095848.12589-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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