From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +PWkIeiLqWWC5T8AWB0awg (envelope-from ) for ; Thu, 18 Jan 2024 15:36:56 -0500 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=gRBw/sKJ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8674C1E0D0; Thu, 18 Jan 2024 15:36:56 -0500 (EST) 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 6E09A1E092 for ; Thu, 18 Jan 2024 15:36:54 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01A98385840B for ; Thu, 18 Jan 2024 20:36:54 +0000 (GMT) Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id C96313858418 for ; Thu, 18 Jan 2024 20:32:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C96313858418 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 C96313858418 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609945; cv=none; b=Sht1EyYu/Q3tUnrFqGlEgDocmDshNxFGjkhEhcOCAO7kf/36FYISRZXV5Bk5+ePJGygo+T9wbm5ir7nYol5687pP8LrF8YpBsl5xYvxS8+54Z7i8vprRQmGJVABuPNZGSCVlGftgAkcERyNKigHgGCC+wE5qJWuqX9iaGGnFDHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609945; c=relaxed/simple; bh=+43odcif+hBkHl0XeTKiXdWu5bIEmDoOIedK5xGYXk4=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=DeSrQHWQHZRMhLq24O/uYceh8HJSV4QHs+Ut0xa6RzNoRdgZUwBvPvemg3kWC1k3gq1n49ajXA9U8h6R24lYDfzx8Jmw0uudWyyTZZMX8lRE/HqEEEFQ7wFJ3xLJB/1XT5x6XLOOznDu48jfbbGdAiEj4l8fMdQZqobXmJsN+Zw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id QNmlrKebGMVQiQZ3erEcTv; Thu, 18 Jan 2024 20:32:14 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QZ3dr6xzNBnVCQZ3drv2Ts; Thu, 18 Jan 2024 20:32:13 +0000 X-Authority-Analysis: v=2.4 cv=H+TIfsUi c=1 sm=1 tr=0 ts=65a98acd a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=fapS_FOKSIiKDB77OEMA: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=OSYLl9iNMSFianRAQsmsnoMPXGUY+0o0zjqteEkxphw=; b=gRBw/sKJ7620qAg5MsNReOj1C6 /TcGrr+MbQapOdpDpjt1ZIPB+7ZcsryvfRdx5XgY4WowAL9b0o9Wd1YuIiwi2xERTyltgLB7dMVqo QVadZ2zyamCelPkSO/DnUht3W; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:50746 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 1rQZ3c-002DCj-3A for gdb-patches@sourceware.org; Thu, 18 Jan 2024 13:32:13 -0700 From: Tom Tromey Date: Thu, 18 Jan 2024 13:32:20 -0700 Subject: [PATCH v2 22/30] Simplify some symbol searches in linespec.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240118-submit-domain-hacks-2-v2-22-aecab29fa104@tromey.com> References: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@tromey.com> In-Reply-To: <20240118-submit-domain-hacks-2-v2-0-aecab29fa104@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.68.157 X-Source-L: No X-Exim-ID: 1rQZ3c-002DCj-3A X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:50746 X-Source-Auth: tom+tromey.com X-Email-Count: 24 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIlw4WD+Og/1fTsRNLMbCHxEOlpFJp4arqMiJ16TC3MTkIPkt/Yiwl4CgSMfJ8AeVrOy8xT8l7U6iiqHA1DmS64uUpWyYkd95IqhnC09ANRoCE+KOnqE 6ckgJopyIl8Wqg46Z2b6s1xzkNgNl6c+W8bMlyibm4iqGqhPUro8v57Su9WfEaMWa1+v1zumdUuZZEYOeW4bSJKLdr3UweESytc= X-Spam-Status: No, score=-3022.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, 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+public-inbox=simark.ca@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 4e43bf28a67..b5bbd8c433c 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3446,14 +3446,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 @@ -3463,10 +3458,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); } } -- 2.43.0