From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i/jgCALO7WdRjyQAWB0awg (envelope-from ) for ; Wed, 02 Apr 2025 19:53:38 -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=UcPrGi0g; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 17D701E0C3; Wed, 2 Apr 2025 19:53:38 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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 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 98B2D1E0C0 for ; Wed, 2 Apr 2025 19:53:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DD4F385780C for ; Wed, 2 Apr 2025 23:53:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DD4F385780C 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=UcPrGi0g Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 9B0073857833 for ; Wed, 2 Apr 2025 23:45:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B0073857833 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 9B0073857833 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743637514; cv=none; b=weqUrxLZieExv+3KJE7aLzIf8pO+HlhN8rQrVGaWilyeHOAazhWVYQaviY5I516sOgxSpF/PD/Uh5wpmmtW7yMizIz2pcXuW37Zo4kSPC0JaLmS5W/xONStttvuTdDiVuOJjaHERuxIwzDOrSbcMk8qTmpBNjbF7AO8TfgCi1mY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743637514; c=relaxed/simple; bh=p8h0Mz4RaWHZW6QDWCrBta6cFuuDFGGBVPdE7ZgmCmQ=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=oMJSIzUmgYgHVt392lSto2YDveaWi1zwmd3RydnxWLV8r+IceZtouPO/WN60ev8AMUhjK8B68apFI2ya8TQMyGU/fGWZZbsmKP4sF7JtW6uLxzr2SPU1lH72Zub9u+zJtZs4q4jgFsuz4yXASc+/vDdNafMfTei5pC+zFKcjG8A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B0073857833 Received: from eig-obgw-5002a.ext.cloudfilter.net ([10.0.29.215]) by cmsmtp with ESMTPS id zi5YtX4ZXf1UX07lhuFIk5; Wed, 02 Apr 2025 23:45:13 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 07lgupXZfJ4Pg07lhu0e3M; Wed, 02 Apr 2025 23:45:13 +0000 X-Authority-Analysis: v=2.4 cv=ZaLWNdVA c=1 sm=1 tr=0 ts=67edcc09 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=ItBw4LHWJt0A:10 a=7tOcaJj6mPL8uAEvJv0A:9 a=QEXdDO2ut3YA:10 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=rR4zRaUgYSlvlRgI4lzAEfj2t2QL8sHEzlAPHVsLZ3w=; b=UcPrGi0gSjfWNoX818E/MGwD5p bnL/esWL1N4QFgtj02R8a3dqpz2P5Y21PBXZ+GBOc6WBfGTEwDvcd6PWHEBp0zsHgfPuqp+7DtAXZ GsWNk+T+9wSWZ4lH2IvIINjDi; 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 1u07lg-000000014hd-1Qvk; Wed, 02 Apr 2025 17:45:12 -0600 From: Tom Tromey Date: Wed, 02 Apr 2025 17:45:04 -0600 Subject: [PATCH v2 05/28] Fix index's handling of DW_TAG_imported_declaration MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250402-search-in-psyms-v2-5-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: 1u07lg-000000014hd-1Qvk 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: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJQNLb/AcWbpG6bM1PqACR4gTfFzSdPEaB2kw8duqcFVyvGrWB8ySSF6DBBqdIWUpwT3zOmf65SqdH6Wiayi2FsUjZ2nCfZilpIetB3SLEMDJ6BnNpYt bEE8umqQBa9y8SzBi2Z866gjCaoZMR7rB1g2tV39DRpob9QXL8XcrDEhRQvSvrBRJS2EswR/sHZglriLsbnMjIoxzxA36qubVpo= 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 Currently the full symbol reader puts DW_TAG_imported_declaration in TYPE_DOMAIN, in the global scope. This patch changes the cooked indexer to follow. Without this patch, a later patch in the series would cause nsalias.exp to regress. This also updates read-gdb-index.c to do something similar. --- gdb/dwarf2/cooked-indexer.c | 5 +++++ gdb/dwarf2/read-gdb-index.c | 2 +- gdb/dwarf2/tag.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/dwarf2/cooked-indexer.c b/gdb/dwarf2/cooked-indexer.c index 7b9ffa79fe8fd6575a7d8c57424895073e790fba..bf9f1384781c54e067cb7e8441a5900613207a20 100644 --- a/gdb/dwarf2/cooked-indexer.c +++ b/gdb/dwarf2/cooked-indexer.c @@ -552,6 +552,11 @@ cooked_indexer::index_dies (cutu_reader *reader, flags &= ~IS_STATIC; flags |= parent_entry->flags & IS_STATIC; } + else if (abbrev->tag == DW_TAG_imported_declaration) + { + /* Match the full reader. */ + flags &= ~IS_STATIC; + } if (abbrev->tag == DW_TAG_namespace && m_language == language_cplus diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 343916309d7c4ca1072d3b11e4fa144d5ec435f4..eeaa38a502c09a0acdd1b60a1c0b8403843aa9fe 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -1098,7 +1098,7 @@ dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx, mask = SEARCH_TYPE_DOMAIN | SEARCH_STRUCT_DOMAIN; break; case GDB_INDEX_SYMBOL_KIND_OTHER: - mask = SEARCH_MODULE_DOMAIN; + mask = SEARCH_MODULE_DOMAIN | SEARCH_TYPE_DOMAIN; break; } if ((kind & mask) == 0) diff --git a/gdb/dwarf2/tag.h b/gdb/dwarf2/tag.h index 865c2bc109d1bf41aa4365a5cf9bda66a1ced65b..ef1ad217c6d34fbacdf5f6372b0d29ad3b6e7bbd 100644 --- a/gdb/dwarf2/tag.h +++ b/gdb/dwarf2/tag.h @@ -102,6 +102,10 @@ tag_matches_domain (dwarf_tag tag, domain_search_flags search, language lang) } break; + case DW_TAG_imported_declaration: + /* DW_TAG_imported_declaration isn't necessarily a type, but the + scanner doesn't track the referent, and the full reader + also currently puts it in TYPE_DOMAIN. */ case DW_TAG_padding: case DW_TAG_array_type: case DW_TAG_pointer_type: -- 2.46.1