From patchwork Tue Nov 21 03:53:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 80403 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 530D8385829E for ; Tue, 21 Nov 2023 03:54:44 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id B47433858C2A for ; Tue, 21 Nov 2023 03:53:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B47433858C2A 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 B47433858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700538806; cv=none; b=fEShLro6SwWtYAhjxs89brmQalocAg191pxqa/VxuXU0FIM3amW9Rme8I5sB4UVLtgtqg+Jnk37fFHtjQhKVonnm5R6jRynpoUaaBZNC0AR9hDvDCMejUgT3ZVz2jImKDjCG0tobl7eNFZq+IzUy27YUjtWLqNIoYk7Ch97x3DI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700538806; c=relaxed/simple; bh=Sit9Lg8LW9jljzBmoQjkR1aX/rB6vC9trME07VfKUGY=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=JuizQqzmlTscd18z9enPWFEzLzIRzYDhoJF6Rl/jeiwg8IPTtgQZJ7J7sIDKSYe0yb3/p96Rcjbdg2FhiIbU6Jr/W4gtP79T2zxsVFyX1MrInbULLAP5IqhI6Dm24vlKFXJzScTPDX04fvD4wOr0UuRRiyC9+n+8UGR4rUKZf2Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5008a.ext.cloudfilter.net ([10.0.29.246]) by cmsmtp with ESMTPS id 5BwgrOlYQjtZ35HpHrWyo3; Tue, 21 Nov 2023 03:53:27 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 5HpBr9L0XkUbt5HpCrQVX6; Tue, 21 Nov 2023 03:53:22 +0000 X-Authority-Analysis: v=2.4 cv=WpU4jPTv c=1 sm=1 tr=0 ts=655c29b2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=KeMcekxUm0Ol8IqNVy0A:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc: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=p1zcxE/7wn6VA2VSCrVEe+jdsZTEtYScy3KA2HL91qs=; b=nW9P6bnVkrSzu8Dhx07dAie/Hx vK3l9DnyA2NDxwRYK3PaUPEZDchOEGsDfoOZxtiNgzTBFoiDD/ktuZTXvHoa+ow9cOJzl45jWMXg1 beF/jjIBGyFiB46zCvsVjxlxP; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:47856 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1r5HpB-0040be-1d for gdb-patches@sourceware.org; Mon, 20 Nov 2023 20:53:21 -0700 From: Tom Tromey Date: Mon, 20 Nov 2023 20:53:52 -0700 Subject: [PATCH 21/29] Simplify some symbol searches in linespec.c MIME-Version: 1.0 Message-Id: <20231120-submit-domain-hacks-2-v1-21-29650d01b198@tromey.com> References: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@tromey.com> In-Reply-To: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 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.77.73 X-Source-L: No X-Exim-ID: 1r5HpB-0040be-1d X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net ([192.168.0.21]) [97.122.77.73]:47856 X-Source-Auth: tom+tromey.com X-Email-Count: 22 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFTKffQKBsw6/C+dk/jGncyDlsKPCG0QLrAQvVRNr0ucixT4qBPaZxWbX7yN/B52Wmngc6X/wwVtz8QS/o6r2oL7Oko3w/HrO8DxZvE1u3GSZbjfXYu1 PoTUtbUx3V/xGItOJlootiLRUefO99UFvnipmGITS1QCVnP3cFLZZgrvIKK+pFYRQ4bqS9GQ3KIQlOjCEO6BZw747x4/ghyH/HU= X-Spam-Status: No, score=-3024.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 This simplifies some symbol searches in linespec.c. In particular, two separate searches here can now be combined into one, due to the new use of flags. Arguably the STRUCT_DOMAIN searches should perhaps not even be done. Only C really has these, and C doesn't have member functions. However, it seems relatively harmless -- and clearly compatible -- to leave this in. --- gdb/linespec.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/gdb/linespec.c b/gdb/linespec.c index e840a137cfb..c7e6c7444d5 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3438,14 +3438,9 @@ lookup_prefix_sym (struct linespec_state *state, for (const auto &elt : file_symtabs) { if (elt == nullptr) - { - iterate_over_all_matching_symtabs (state, lookup_name, - SEARCH_STRUCT_DOMAIN, - NULL, false, collector); - iterate_over_all_matching_symtabs (state, lookup_name, - SEARCH_VFT, - NULL, false, collector); - } + iterate_over_all_matching_symtabs (state, lookup_name, + SEARCH_STRUCT_DOMAIN | SEARCH_VFT, + NULL, false, collector); else { /* Program spaces that are executing startup should have @@ -3455,10 +3450,7 @@ lookup_prefix_sym (struct linespec_state *state, gdb_assert (!pspace->executing_startup); set_current_program_space (pspace); iterate_over_file_blocks (elt, lookup_name, - SEARCH_STRUCT_DOMAIN, - collector); - iterate_over_file_blocks (elt, lookup_name, - SEARCH_VFT, + SEARCH_STRUCT_DOMAIN | SEARCH_VFT, collector); } }