From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8R2jF4mo6GnekTMAWB0awg (envelope-from ) for ; Wed, 22 Apr 2026 06:52:57 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=ta5PHF3i; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5C0601E0C3; Wed, 22 Apr 2026 06:52:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 A7DFD1E067 for ; Wed, 22 Apr 2026 06:52:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6743C409FB80 for ; Wed, 22 Apr 2026 10:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6743C409FB80 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=ta5PHF3i Received: from mail-24421.protonmail.ch (mail-24421.protonmail.ch [109.224.244.21]) by sourceware.org (Postfix) with ESMTPS id 0C40848FE231 for ; Wed, 22 Apr 2026 10:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C40848FE231 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=vrany.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrany.io ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0C40848FE231 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=109.224.244.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776853801; cv=none; b=Q7GTUnpmrKusUGkcRsRa6xzhnuO/YmnNvuhKKP5Eamk9z4XWfIluD0plxmKnxNW3lO27uR28u87VKkGqoctsgltxbc+Kfgbk+N2AKw3ydhv4hVKezFjFMLBnkD6p2jsfUrUDQEHLhW/2kRvxg1j+utmxBdDCA+HgPNaOOnYdHYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776853801; c=relaxed/simple; bh=ljSJw1qOh0Ecjz0I3UyWvPNw/cXcwXTgpRzNIR743lc=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=BbMQzq0LhlY1bC9dGxcYVBWy0rWRLgWoYUUHfKcpAOL7+4v0pLT3vbwQSxsxbw99DxVgt2aCFo9V4urCzREsErhoyYSNLKbW+zQAUAvFFLStaS2A7IUgAm9y4umIOiMbrDWqh72n/exr+qj2D/W/X60Eb9/iwn3GO4S6ZWrWP/s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C40848FE231 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrany.io; s=protonmail3; t=1776853795; x=1777112995; bh=uemdl7wjQ1LaW7hIkeJgfYCSQlN6SjmSt2pNM6iDPd4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ta5PHF3iJOZgTMqiE0JyKDFZWyu10DCn1/Zr3Hhne2Yjlpu+Am7/tMV6riJlS8Sd/ AkjKxdR0JY26cymRXLuENN5FsfeBrdFIhTBuk9l46kLQYBYQs7e4p2NVCyz4n0oHHB BfNft6Z0qZJDc4VlBDKFcWCKcXeZjOhyMkbRshPai0oZfs2GPjjkRzmZYHx28BwsCW zsRlBGAhPISb2YlFUx7JQufEz+UDpkohJQC7hIlPO9Ze636z7YaWVSi6pH6kdI9jvZ sru1XTBKhqWLLKGCJMPBuqBN0yuN8zdgkJoA9qXREPFjtY/HGC16owWw9S87m0Rxqd BfWE3cQcU3rHw== Date: Wed, 22 Apr 2026 10:29:48 +0000 To: gdb-patches@sourceware.org From: Jan Vrany Cc: Jan Vrany , Tom Tromey Subject: [PATCH v3 2/7] gdb: update expanded_symbols_functions::find_pc_sect_compunit_symtab Message-ID: <20260422102923.1185738-3-jan@vrany.io> In-Reply-To: <20260304165914.3209106-1-jan.vrany@labware.com> References: <20260304165914.3209106-1-jan.vrany@labware.com> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: c5f8634f8f1339488890e2bbbff7d729ea06397b MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 This commit updates expanded_symbols_functions::find_pc_sect_compunit_symta= b to search all compunits rather than just returning null. The original implementation (just return null) was based on reasoning that its would suffice since find_compunit_symtab_for_pc_sect walks all CUs anyway [1]. This commit is a preparation to simplify find_compunit_symtab_for_pc_sect by removing that code. Approved-By: Tom Tromey Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D33829 [1] https://inbox.sourceware.org/gdb-patches/874iqoogoa.fsf@tromey.com/ --- gdb/expanded-symbol.c | 18 ++++++++++++++++++ gdb/expanded-symbol.h | 8 +------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gdb/expanded-symbol.c b/gdb/expanded-symbol.c index 6dcb4047e3f..81f592bb71d 100644 --- a/gdb/expanded-symbol.c +++ b/gdb/expanded-symbol.c @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . = */ =20 +#include "block.h" #include "objfiles.h" #include "symtab.h" #include "source.h" @@ -115,3 +116,20 @@ expanded_symbols_functions::find_symbol_by_address (ob= jfile *objfile, =20 return nullptr; } + +/* See expanded-symbol.h. */ + +compunit_symtab * +expanded_symbols_functions::find_pc_sect_compunit_symtab + (objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, + obj_section *section, int warn_if_readin) +{ + for (compunit_symtab *symtab : m_compunit_symtabs) + { + const blockvector *bv =3D symtab->blockvector (); + if (bv !=3D nullptr && bv->contains (pc)) +=09return symtab; + } + + return nullptr; +} diff --git a/gdb/expanded-symbol.h b/gdb/expanded-symbol.h index 68f5532e6b8..d57ca4ef4ce 100644 --- a/gdb/expanded-symbol.h +++ b/gdb/expanded-symbol.h @@ -77,13 +77,7 @@ struct expanded_symbols_functions : public quick_symbol_= functions =20 compunit_symtab *find_pc_sect_compunit_symtab (objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc, - obj_section *section, int warn_if_readin) override - { - /* Simply returning NULL here is okay since the (only) caller - find_compunit_symtab_for_pc_sect iterates over existing CUs - anyway. */ - return nullptr; - } + obj_section *section, int warn_if_readin) override; =20 symbol *find_symbol_by_address (objfile *objfile, CORE_ADDR address) override; --=20 2.53.0