From patchwork Sun Apr 6 11:15:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Batlle_i_Rossell?= X-Patchwork-Id: 109927 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 3F33A384A4BC for ; Sun, 6 Apr 2025 11:15:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F33A384A4BC Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=viric.name header.i=@viric.name header.a=rsa-sha256 header.s=dkim1 header.b=NuQISF7E X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail.viric.name (mail.viric.name [37.18.133.75]) by sourceware.org (Postfix) with ESMTPS id 4FEF93857354 for ; Sun, 6 Apr 2025 11:15:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FEF93857354 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=viric.name Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=viric.name ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4FEF93857354 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=37.18.133.75 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743938114; cv=none; b=FkyGGuj+/8vmp87Qplop9DMvIhM2WZYO9VUBrrle3LFieVsdqP2czS9cH3UmipFYP8CSurY2H0O2qeO1TZCJuKCLv8Np7BWzcEZyyB5tkaLP/Wlp510jQ26QYC+6RJfqLfS/GAPRroQ3PLtTLH5Rwt83o9QClB5iKQPWHavB92A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743938114; c=relaxed/simple; bh=MYyIt45KA4jaZB0cReLtLIjIdlsPEqstGkb/G/R9bqg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Dmd5pYQ2YM3gdI3KNo2tUl/1XDSy2SLY+slWfkVhQ1N0luWATKbzFQPIfnw8uONOA60mfOxqnmcm0WM2jC5kKB9CnJKNPUkIuY5LfaSNAUbHNZotMr1PrsPt7YFOD/+lSNlk0XJjpc/x6w2j6xpo66f8OdBXWhGBp4jnPhAzt30= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FEF93857354 Received: by mail.viric.name (Postfix, from userid 1000) id 4BB2C1A8C57A; Sun, 06 Apr 2025 13:15:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=viric.name; s=dkim1; t=1743938113; bh=MYyIt45KA4jaZB0cReLtLIjIdlsPEqstGkb/G/R9bqg=; h=Date:From:To:Subject; b=NuQISF7EIwifB4sla65l+2QduiO2LzV/7iZp+JfwNbdNcpol+pbQR0fzAY/Qz11YD W2AyZiaVUC7nhEgTaIVrBgwAxKjMY5IybR/crbhBMxOY8YikOvLh13AIBgQ2u76n92 jIbtKGLOozDkSR6UUDIDH327MsQE9ejtUBrZqrOc= Date: Sun, 6 Apr 2025 13:15:13 +0200 From: =?utf-8?b?TGx1w61z?= Batlle i Rossell To: gdb-patches@sourceware.org Subject: [PATCH] Document that index-cache requires build ID Message-ID: X-Accept-Language: ca, es, eo, ru, en, jbo, tokipona MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-8.5 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: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org Attached From 4dfcd1888e3fc3c5707e3f697268d820679a1c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= 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 --- gdb/doc/gdb.texinfo | 2 ++ gdb/dwarf2/read.c | 4 ++++ 2 files changed, 6 insertions(+) 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 information, not stabs. 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 the future. This feature can be turned on with @kbd{set index-cache enabled on}. +Note that the cache will use the ELF build ID to identify the cached indices, +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. @table @code diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 71fd352343a..f6a221a57de 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2237,7 +2237,11 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) { const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); if (build_id == nullptr) + { + dwarf_read_debug_printf ("Not using index-cache for %s due to missing build-id", + objfile_name (obj)); return {}; + } return global_index_cache.lookup_gdb_index (build_id, &dwarf2_per_bfd->index_cache_res);