From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oRt/KXnHmGloLwMAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 15:43:37 -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=DsarOg40; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A09B41E0E1; Fri, 20 Feb 2026 15:43:37 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no 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 5E7561E09A for ; Fri, 20 Feb 2026 15:43:36 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DB7D04BAD16B for ; Fri, 20 Feb 2026 20:43:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB7D04BAD16B 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=DsarOg40 Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 5DF484BA23EE for ; Fri, 20 Feb 2026 20:42:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DF484BA23EE 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 5DF484BA23EE 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=1771620146; cv=none; b=t5MKINky529heOkgCKHGY+hqFNg7+SCSYtxRJg+KAeED/rMh+79bfMnhAtdoUy9vz75dejJ38kOPmq57WZxxyBZaD8J4QtA4HXRv9MCPky8H/g8WqX0DcQPDi2Tm1B0PFndMr60p4esp7tZmKSQfD4fQuwD+lArL193EUGBMOX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771620146; c=relaxed/simple; bh=w4aeOSbrZ30Vv6e0KXewO1thcsQh72LQm27ysPCXJjc=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=avQFf74ZrzHKmMZin+qZDE+vxSAvuHB2NZ+wRaqgdD9TfD3XpZ6BbB89Zs+rwA56VdPLv0Vt8zTU17yVkKBI0Lj71tslvtTWgIue/MADiONMIfVT0iURC4qIg5V/GnVKKGUnnBBvZ9nddKbEUbkMZYa/NluN7k1qHmqeeBzqjPo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DF484BA23EE Received: from eig-obgw-6001b.ext.cloudfilter.net ([10.0.30.143]) by cmsmtp with ESMTPS id tVuRvONIoKjfotXKTv84N6; Fri, 20 Feb 2026 20:42:25 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id tXKSv4XuPcu11tXKTvXtSG; Fri, 20 Feb 2026 20:42:25 +0000 X-Authority-Analysis: v=2.4 cv=bKYWIO+Z c=1 sm=1 tr=0 ts=6998c731 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=E3GEoR-R2Vu0HJ2l7RoA:9 a=QEXdDO2ut3YA:10 a=DCx65vhANUyCzuf5D8fC: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=PjgwvUweuo987npeFTEduXzaOHdzJifp49EF7gXQ0AM=; b=DsarOg40KNBbrjzssba3c9qllS 7AIdveLLQ/KBi7LboR0sZFv+lVRG1mEyq8FBapJF51NW6q3aqJB7y0Ikgp98nG+aPVH9q99mU4j6P Tz1x5ISSrdodYkjRSfegBPqiT; Received: from 97-122-122-234.hlrn.qwest.net ([97.122.122.234]:49908 helo=[192.168.122.1]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vtXKS-00000000Jtq-2XGk; Fri, 20 Feb 2026 13:42:24 -0700 From: Tom Tromey Date: Fri, 20 Feb 2026 13:42:24 -0700 Subject: [PATCH v3 4/8] Combine two cases in cooked_index_functions::search MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260220-dw-inline-fixup-pr-symtab-30728-2-v3-4-98ae8ab28fab@tromey.com> References: <20260220-dw-inline-fixup-pr-symtab-30728-2-v3-0-98ae8ab28fab@tromey.com> In-Reply-To: <20260220-dw-inline-fixup-pr-symtab-30728-2-v3-0-98ae8ab28fab@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 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.122.234 X-Source-L: No X-Exim-ID: 1vtXKS-00000000Jtq-2XGk X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-122-234.hlrn.qwest.net ([192.168.122.1]) [97.122.122.234]:49908 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGzA5Umh7lqXTdtbyUXfCT77MR6j15I7WRenCA8NfFSQ7t2Sh2ykO/Jmrah1vU7L1OykQZjW5ebfj3xgA7BptpmUUJN9EshkvQk3LaSgpYJ/f0td6wY0 135hHwKAjIxUx1/HRAjVx8IzsT1MV9t70lPFJ+IoGuQw08+rnsg9KEDctYKS7dzPocK5/vOH6JFMJbZvJZmPQQE1UVPZVxMl1Ec= 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 combines a couple of 'if' statements in cooked_index_functions::search. This simplifies the code a little and also makes a subsequent patch a bit simpler as well. --- gdb/dwarf2/read.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index f545a3158e9..184ffe1c213 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -14188,25 +14188,22 @@ cooked_index_functions::search || !entry->matches (domain)) continue; - if (lang_matcher != nullptr) + /* If LANG_MATCHER is non-NULL, try to skip CUs with a + non-matching language. The other case here is a bit of a + hack to support .gdb_index. Since .gdb_index does not + record languages, and since we want to know the language + to avoid excessive CU expansion due to false matches, if + we see a symbol with an unknown language we find the CU's + language. Only the .gdb_index reader creates such + symbols. */ + enum language entry_lang = entry->lang; + if (lang_matcher != nullptr || entry_lang == language_unknown) { - /* Try to skip CUs with non-matching language. */ entry->per_cu->ensure_lang (per_objfile); - if (!entry->per_cu->maybe_multi_language () + if (lang_matcher != nullptr + && !entry->per_cu->maybe_multi_language () && !lang_matcher (entry->per_cu->lang ())) continue; - } - - /* This is a bit of a hack to support .gdb_index. Since - .gdb_index does not record languages, and since we want - to know the language to avoid excessive CU expansion due - to false matches, if we see a symbol with an unknown - language we find the CU's language. Only the .gdb_index - reader creates such symbols. */ - enum language entry_lang = entry->lang; - if (entry_lang == language_unknown) - { - entry->per_cu->ensure_lang (per_objfile); entry_lang = entry->per_cu->lang (); } -- 2.49.0