From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lUifHFTomWlsSwQAWB0awg (envelope-from ) for ; Sat, 21 Feb 2026 12:16:04 -0500 Received: by simark.ca (Postfix, from userid 112) id 5DC0E1E0BA; Sat, 21 Feb 2026 12:16:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 70D181E089 for ; Sat, 21 Feb 2026 12:16:02 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5E7F94BA23E1 for ; Sat, 21 Feb 2026 17:16:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E7F94BA23E1 Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A4AF94BA2E24 for ; Sat, 21 Feb 2026 17:15:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4AF94BA2E24 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A4AF94BA2E24 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771694135; cv=none; b=TNN3B8p60xB0ANiWhM9xvZi6liwSCc1HsoxsB0uChZljYvLzovQWod/J+nlzNVt8CWcZyOVztncbokQYKOm93VYadopKeMxeNCVQeuwxgZRntpvqgZsqa9DB7GksYxd5aQXSAIqsnEcXwhMBShibu2zmh5jewMj1k94T7gB5oeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771694135; c=relaxed/simple; bh=Aeetg7mp7kaaTwWn5C8jSusR5lCEoCz5lA2a+4rKVM4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=tuLbcd0Wqt2Wb4lJntsjFyoW4HL68hwusoUkUL3mZmynAYpPpEDCpOcy+iD/9qwwF3CXyIolz6vPM/Oqxpt/cq9+cQY9dYRe3ZQ6o0CRsMOXNWWYxfH7Ws9nWSUo29GjBsv2gaNx8QKYnb1YbzTdcarl/xnHjdNUqOTWJ/1GwZY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4AF94BA2E24 Received: from mop.sam.mop (2.8.3.0.0.0.0.0.0.0.0.0.0.0.0.0.a.5.c.d.c.d.9.1.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:19dc:dc5a::382]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam) by smtp.gentoo.org (Postfix) with ESMTPSA id 98926342A82; Sat, 21 Feb 2026 17:15:33 +0000 (UTC) From: Sam James To: Eli Zaretskii Cc: Guinevere Larsen , viric@viric.name, gdb-patches@sourceware.org Subject: Re: [PATCH] Document that index-cache requires build ID In-Reply-To: <86zfgeav8v.fsf@gnu.org> Organization: Gentoo References: <86zfgeav8v.fsf@gnu.org> User-Agent: mu4e 1.12.15; emacs 31.0.50 Date: Sat, 21 Feb 2026 17:15:28 +0000 Message-ID: <87tsvaxbkf.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> Date: Thu, 17 Apr 2025 14:06:31 -0300 >> Cc: "Eli Zaretskii (eliz@gnu.org)" >> From: Guinevere Larsen >>=20 >> From 4dfcd1888e3fc3c5707e3f697268d820679a1c7b Mon Sep 17 00:00:00 2001 >> From: =3D?UTF-8?q?Llu=3DC3=3DADs=3D20Batlle=3D20i=3D20Rossell?=3D >> Date: Sun, 6 Apr 2025 13:11:06 +0200 >> Subject: [PATCH] Document that index-cache requires build ID >>=20 >> --- >> gdb/doc/gdb.texinfo | 2 ++ >> gdb/dwarf2/read.c | 4 ++++ >> 2 files changed, 6 insertions(+) >>=20 >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index e034ac53295..37b65ab72ac 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -22934,6 +22934,8 @@ Indices only work when using DWARF debugging in= formation, not stabs. >> It is possible for @value{GDBN} to automatically save a copy of this i= ndex in a >> cache on disk and retrieve it from there when loading the same binary = in the >> future. This feature can be turned on with @kbd{set index-cache enabl= ed on}. >> +Note that the cache will use the ELF build ID to identify the cached i= ndices, >> +so files without Build ID will not have their index cached. >> The following commands can be used to tweak the behavior of the index = cache. >>=20 >> Since there are documentation changes, we need Eli Zaretskii to approve = this change. I've CC'd him in this >> email. > > Sorry for missing the original submission. > > The patch for gdb.texinfo is okay, but please use "build ID", not > "Build ID", for the second instance, to be consistent about the > letter-case. > > Reviewed-By: Eli Zaretskii I've gone ahead and taken the liberty to push this as obvious enough, having run into this again recently. I applied your casing tweak and the style tweaks from Guinevere. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Document-that-index-cache-requires-build-ID.patch Content-Transfer-Encoding: quoted-printable From=2010b5513e6d9a5a8d72bff272b6f254a3b68abc56 Mon Sep 17 00:00:00 2001 Message-ID: <10b5513e6d9a5a8d72bff272b6f254a3b68abc56.1771693680.git.sam@ge= ntoo.org> From: =3D?UTF-8?q?Llu=3DC3=3DADs=3D20Batlle=3D20i=3D20Rossell?=3D Date: Sun, 6 Apr 2025 13:11:06 +0200 Subject: [PATCH] Document that index-cache requires build ID Reviewed-By: Guinevere Larsen Reviewed-By: Eli Zaretskii =2D-- gdb/doc/gdb.texinfo | 2 ++ gdb/dwarf2/read.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 5b99c2b2e23..3b2401117c7 100644 =2D-- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -23198,6 +23198,8 @@ Indices only work when using DWARF debugging inform= ation. It is possible for @value{GDBN} to automatically save a copy of this index= in a cache on disk and retrieve it from there when loading the same binary in t= he future. This feature can be turned on with @kbd{set index-cache enabled o= n}. +Note that the cache will use the ELF build ID to identify the cached indic= es, +so files without build ID will not have their index cached. The following commands can be used to tweak the behavior of the index cach= e. =20 @table @code diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 5f18d5f2e9a..302b137526f 100644 =2D-- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2302,7 +2302,11 @@ get_gdb_index_contents_from_cache (objfile *obj, dwa= rf2_per_bfd *dwarf2_per_bfd) { const bfd_build_id *build_id =3D build_id_bfd_get (obj->obfd.get ()); if (build_id =3D=3D nullptr) =2D return {}; + { + dwarf_read_debug_printf ("Not using index-cache for %s due to missin= g build-id", + objfile_name (obj)); + return {}; + } =20 return global_index_cache.lookup_gdb_index (build_id, &dwarf2_per_bfd->index_cache_res); base-commit: 646982f4295bf0a1e64867606d496c34c9a15a0c =2D-=20 2.53.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmmZ6DAbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkCcx AQCU04YZkdYAtBNWK9NtbeSqzHlPnAZrlhqy9YxD4AmHoAEApr82WeyUNkv17Azc Hx2OaSfoFJpTPxSq1PjdItLpBwc= =8cR9 -----END PGP SIGNATURE----- --==-=-=--