From patchwork Tue Sep 12 09:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 75719 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE3153858C3A for ; Tue, 12 Sep 2023 09:59:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE3153858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694512763; bh=1FrclGDcUJ1xXHokNWzvoa4zbJgMgKKnXt3Tf2g8kg4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Wc+MmMeTD9+r+0bPQolWE553JSRH0th3D5ygcb/8ENYTWeN/l3TpWErb2URD4dxyO 1hB2y9Yn2Og8uF5chPIprRVwSY6dnUMOiNHn6qW0sLhat14HBlJaLHQ8oC+RR2/w7Y JaqilS+PwhXn8ViSP1vRN760HuhKmI1357OLLjN8= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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) 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 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "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(-) base-commit: aa240fbd480651bd72b3cebe7b5ea1cda204b7e9 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