From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wEbXAyLN7WeujSQAWB0awg (envelope-from ) for ; Wed, 02 Apr 2025 19:49:54 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=w/8IqDMR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0C0DF1E0C3; Wed, 2 Apr 2025 19:49:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 B06021E0C0 for ; Wed, 2 Apr 2025 19:49:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6244A385B527 for ; Wed, 2 Apr 2025 23:49:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6244A385B527 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=w/8IqDMR Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id 36DD0385B834 for ; Wed, 2 Apr 2025 23:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36DD0385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 36DD0385B834 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743637519; cv=none; b=UR00tfQSTbe6llj0xKmJzRh7MxiGU2BS7z656+xeC5zJMlGGdu9Z/m0YaqoY9fUFTpMuvuGkktOBBcTowTp/2F8cklS+/j2vXutZ5uOCOWNcdQHiBKzdDWaILQACoip3yjd4a2ZyqwKro6lWofJmdSwGrUw6MXz/iIGwZFGKOFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743637519; c=relaxed/simple; bh=bXEKoxRh9/wbKDXrebk5d2UgXQ+H3iRRm7dnCFd9Qow=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=EaBCl7YHBQ56NonYvYQhqwfuBxyEwTS9lyJOIeghcZ8HKW4VgzoRgJ3F6Y5neZYAp5HQItDev574LdguN3HJQiDcqa/CpKahB2j/ZWjCA/XINXc041mjJVKSEirXZFz5eV/AUTY2MrlG9une4m7vnMC/xeaJl0qPmz4V6jGllB4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36DD0385B834 Received: from eig-obgw-5003a.ext.cloudfilter.net ([10.0.29.159]) by cmsmtp with ESMTPS id 05sgunCB6zZPa07lnuJzDy; Wed, 02 Apr 2025 23:45:19 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 07lluSqxQliBX07lmup7KF; Wed, 02 Apr 2025 23:45:18 +0000 X-Authority-Analysis: v=2.4 cv=bOXdI++Z c=1 sm=1 tr=0 ts=67edcc0e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=ItBw4LHWJt0A:10 a=CCpqsmhAAAAA:8 a=DB3L4cRBAtWgj855KRIA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rig5+OfY0tIVhPlicgeWlbx3Deoptx0pthT8kxqY3I8=; b=w/8IqDMRx3cAOMfeJtH6LdtO1p 4ZQdhczpSJFkthijF7mrQ6jqHU7xuyH/YFCrjIvPnk5fdQ+f68lGmfFaH2QY/CUzsRlPEFRbO3kny 0mFMtuac5M6NkD/WRFQwcXSXd; Received: from 97-122-123-18.hlrn.qwest.net ([97.122.123.18]:56394 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1u07ll-000000014hd-2FIz; Wed, 02 Apr 2025 17:45:17 -0600 From: Tom Tromey Date: Wed, 02 Apr 2025 17:45:15 -0600 Subject: [PATCH v2 16/28] Convert ada-lang.c:map_matching_symbols MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250402-search-in-psyms-v2-16-ea91704487cb@tromey.com> References: <20250402-search-in-psyms-v2-0-ea91704487cb@tromey.com> In-Reply-To: <20250402-search-in-psyms-v2-0-ea91704487cb@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.123.18 X-Source-L: No X-Exim-ID: 1u07ll-000000014hd-2FIz X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-123-18.hlrn.qwest.net (prentzel.local) [97.122.123.18]:56394 X-Source-Auth: tom+tromey.com X-Email-Count: 17 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEA3AfK4qeeTdZoUktIhxHd4rpe10wBpGkUBjVFhcTeAq4VMgU+d93VUn4nzPT7sNunvUJxl4IT3/j04QfSHdys/ekVQWOvqOkYrA1dGo0In4L2xKnNq picWN0M4GUmoNr7f+ifZKbbySiBEVlr3iy3Q7QkYvIWczFtOCVuAiTZZB3lFV5TqLZJnhsrnycGfpeN0E3qOSDFRfYMWCI/vqKQ= 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 converts ada-lang.c:map_matching_symbols to the callback approach, merging the search loop and the call to expand_symtabs_matching. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16994 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16998 --- gdb/ada-lang.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3dc48125dee8aa424bc787a89323264d75837926..a8fc70688591d2f4bcd00a21fd164c386d4269d8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5529,22 +5529,22 @@ map_matching_symbols (struct objfile *objfile, match_data &data) { data.objfile = objfile; - objfile->expand_symtabs_matching (nullptr, &lookup_name, - nullptr, nullptr, - global - ? SEARCH_GLOBAL_BLOCK - : SEARCH_STATIC_BLOCK, - domain); const int block_kind = global ? GLOBAL_BLOCK : STATIC_BLOCK; - for (compunit_symtab *symtab : objfile->compunits ()) + auto callback = [&] (compunit_symtab *symtab) { const struct block *block = symtab->blockvector ()->block (block_kind); - if (!iterate_over_symbols_terminated (block, lookup_name, - domain, data)) - break; - } + return iterate_over_symbols_terminated (block, lookup_name, + domain, data); + }; + + objfile->expand_symtabs_matching (nullptr, &lookup_name, + nullptr, callback, + global + ? SEARCH_GLOBAL_BLOCK + : SEARCH_STATIC_BLOCK, + domain); } /* Add to RESULT all non-local symbols whose name and domain match -- 2.46.1