From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EeSQAhrImGklMAMAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 15:46:18 -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=gYGCKjf6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0493D1E08D; Fri, 20 Feb 2026 15:46:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 4FD4C1E08D for ; Fri, 20 Feb 2026 15:46:17 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DBC4D4BA23EE for ; Fri, 20 Feb 2026 20:46:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBC4D4BA23EE 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=gYGCKjf6 Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id C3F7D4BA23FA for ; Fri, 20 Feb 2026 20:42:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3F7D4BA23FA 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 C3F7D4BA23FA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771620148; cv=none; b=ZqoRxleDHYRYtvFu9VGYFOwGhVsVOOO3Zm+kxkY5jM7BZFTSJRRwdGxjOwPcpesKrLeZWokUF/hsE1AszckaSfqt1B6e4J8uURrKuIDkeymYOsGMfosxRPppkYxhDU+yn+lX5Fo5KRG20u3kaHZWqY5UZdItSNWJPzNnlf8STPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771620148; c=relaxed/simple; bh=iR+bLf3//KQHKD00vIx4+j4RpCQy/m5CaQPXwH3PfB8=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=aMybTqXTjDX/ZUfqfZyjtSCSYC5XpaJhvKWMuIgD56SDZEaJCXSmsMicBSdWdTZyYzy3F5YDvCwrupB8jhQgFx8lyHrl/DikF6jdTwwAbti7BzfpB4wqsEYdCGkDs0FY5gWkDNU5GDreqr2wvSwzTPHlWVt47au3u3NpD1pLXdg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3F7D4BA23FA Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id tHgTvwltZipkCtXKUvAD50; Fri, 20 Feb 2026 20:42:26 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id tXKTvC4vdSqlVtXKTvZitP; Fri, 20 Feb 2026 20:42:25 +0000 X-Authority-Analysis: v=2.4 cv=I7FlRMgg c=1 sm=1 tr=0 ts=6998c732 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=uRdFjrtL57CU_wxB1n0A: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=AkvySMEUnOwNFmrXMbwoa5xvyiI+qIkr9bZa92xmLeM=; b=gYGCKjf66CZwxvDVZtO7krMDtC WL9U22C0zTJiJtx8d5orxUA5juA8eVCdl2HV5g01H80P3+ABQeUVV7ZKYY3cgjVQ4jaWuknYFEgKW 7hNOZiRiN10YB4GceFUM3BHQL; 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 1vtXKT-00000000Jtq-0azr; Fri, 20 Feb 2026 13:42:25 -0700 From: Tom Tromey Date: Fri, 20 Feb 2026 13:42:26 -0700 Subject: [PATCH v3 6/8] Have iterate_over_one_compunit_symtab search included symtabs 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-6-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: 1vtXKT-00000000Jtq-0azr 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: 10 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLx3tpdZ0Ul27MAEVKWOBUXibLMYPMiNLi/SrXWrVrdAWQB8QJQU8jAqJCEnBFCnWVQo6xv1Z4xnt86yLCGJTHgrhbRaNpDwUJcrrBF3D/+8ROw9A4i+ rXX8aYhV+1z8TPposKa2AzydDdF8BQ/zKrwwyZwNVKOrGu8/ZpMmMXaH9UvfhKbzfr8MyKw5qTM2J/TrmdWNX0VzxmavFFTaUvU= 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 A latent bug in the search-via-psyms series was that it neglected to update iterate_over_one_compunit_symtab to search included symtabs. I think lookups that needed this search used to work by accident -- an included CU would be expanded but not searched, but a search of all compunits() would then find it. This patch corrects the oversight. I'm not sure if this bug is readily visible without the next patch. --- gdb/symfile-debug.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 6562dcad433..2c9deba20ae 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -171,17 +171,12 @@ objfile::forget_cached_source_info () the specified compunit symtab is also searched. */ static bool -iterate_over_one_compunit_symtab (const char *name, +iterate_over_one_compunit_symtab (const char *base_name, + const char *name, const char *real_path, compunit_symtab *cust, gdb::function_view callback) { - const char *base_name = lbasename (name); - - /* Skip included compunits. */ - if (cust->user != nullptr) - return false; - for (symtab *s : cust->filetabs ()) { if (compare_filenames_for_search (s->filename (), name)) @@ -224,6 +219,11 @@ iterate_over_one_compunit_symtab (const char *name, } } + for (compunit_symtab *iter : cust->includes) + if (iterate_over_one_compunit_symtab (base_name, name, real_path, + iter, callback)) + return true; + return false; } @@ -257,10 +257,15 @@ objfile::map_symtabs_matching_filename auto listener = [&] (compunit_symtab *symtab) { + /* Skip included compunits, as they are searched by + iterate_over_one_compunit_symtab. */ + if (symtab->user != nullptr) + return true; + /* CALLBACK returns false to keep going and true to continue, so we have to invert the result here, for search. */ - return !iterate_over_one_compunit_symtab (name, real_path, symtab, - callback); + return !iterate_over_one_compunit_symtab (name_basename, name, real_path, + symtab, callback); }; for (const auto &iter : qf) -- 2.49.0