From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YNIhEOLM7WeujSQAWB0awg (envelope-from ) for ; Wed, 02 Apr 2025 19:48:50 -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=xldUaJ4W; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3CDE31E0C3; Wed, 2 Apr 2025 19:48:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,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 D969E1E0C0 for ; Wed, 2 Apr 2025 19:48:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 85786385B830 for ; Wed, 2 Apr 2025 23:48:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85786385B830 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=xldUaJ4W Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 83C37385780C for ; Wed, 2 Apr 2025 23:45:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83C37385780C 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 83C37385780C 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=1743637514; cv=none; b=ueOKL9tU6l8S/YTNe3a6i4s6JpS4FPFp29e77D1vhE8WJdfoxGJZjpwCWeWO+h1EwiWZO3C5kI3A+PeqikdDZff4d//lWMY2XfVfG2YwwRANvjWJrlJM/dWIswFQRKoZUHsg1Ct3cxsebgu31z6nBlZ7BsupblU9TWJGgNvgv6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743637514; c=relaxed/simple; bh=Rm0Qma/ebcsiHW7vAZQd5Oy2dBeTk3N9o/7Kmn69buE=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=Dp4cRy1OjV6dY1MKbYb6gA1splXfyBJ15JFcCND5q5xrVLr3FAJWVvAW+YnU+EQbiSrEwmF3t0r5BXsfjdd8DsDKs3MoiQTQRONpH8ajF1EDibQV8PK8R2tPTAx0TuqToggma6gVcX6CkeNk4denpotA8GlfnHMtViIjPpAMJsQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83C37385780C Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id 06KduKZLcWuHK07lhuzjxZ; Wed, 02 Apr 2025 23:45:13 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 07lhuYyqp1vNy07lhuVS36; Wed, 02 Apr 2025 23:45:13 +0000 X-Authority-Analysis: v=2.4 cv=VMQWnMPX c=1 sm=1 tr=0 ts=67edcc09 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=ItBw4LHWJt0A:10 a=-ggsfVDSkX4OlrjL1uYA: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=5V6MUgNhBD3GiN9tr6D8pi6QzzlpCscjh9lnSZF0EE8=; b=xldUaJ4WOCKh/LgXCPv1GbyXhC 8awP4aMf99j5z7pDZHJ7Vo+Ci6je4ozCsFDank+ui+ivyAiXyfcqh9AHUZ5NgByLh9xZ2bvjKTfDq JAgVfwz5TQAi0LQnN3jY8Zedq; 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-2pQ8; Wed, 02 Apr 2025 17:45:12 -0600 From: Tom Tromey Date: Wed, 02 Apr 2025 17:45:05 -0600 Subject: [PATCH v2 06/28] Put all CTF symbols in global scope MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250402-search-in-psyms-v2-6-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-2pQ8 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: 7 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfH8FaO+RuUtLIPnWhyLUQr88+whpUYRckZCf/D3Yxa7KSDQbW5RKMDjMsOr0djs04mGJw+IJjQMZUgLYw3CK2WWlxdJLh+ZNGYJU9scOUVbQNxmmhgKQ i1g41qlsWXv304h/AA6cIM6KIpBiIoY4di32iTtxq8nNbSzaFvUMr0Q7jECKhdZx+rgBe4EbYd6ZU0vNdQZXkRrlDnR339LC9VA= 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 The new approach to searching (solely via the quick API) is more sensitive to discrepancies between the partial and full readers. In CTF, there is some disagreement about which scope to use. CTF doesn't seem to really distinguish between the file and global scope, so this patch takes the simple approach of putting all CTF symbols into the global scope. This changes one test as well. It seems to me that the behavior here is arbitrary and the test is making unwarranted assumptions. --- gdb/ctfread.c | 6 +++--- gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/ctfread.c b/gdb/ctfread.c index ee7c30f7d8737cc38aa7fae54d339438ae45377f..b9f8d7350538b52076f0fb91a18c8d6139701d32 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -516,7 +516,7 @@ new_symbol (struct ctf_context *ccp, struct type *type, ctf_id_t tid) break; } - add_symbol_to_list (sym, ccp->builder->get_file_symbols ()); + add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); } return sym; @@ -1171,7 +1171,7 @@ ctf_add_var_cb (const char *name, ctf_id_t id, void *arg) sym->set_domain (VAR_DOMAIN); sym->set_aclass_index (LOC_OPTIMIZED_OUT); sym->compute_and_set_names (name, false, ccp->of->per_bfd); - add_symbol_to_list (sym, ccp->builder->get_file_symbols ()); + add_symbol_to_list (sym, ccp->builder->get_global_symbols ()); break; default: complaint (_("ctf_add_var_cb: kind unsupported (%d)"), kind); @@ -1510,7 +1510,7 @@ ctf_psymtab_type_cb (ctf_id_t tid, void *arg) ccp->pst->add_psymbol (name, false, domain, aclass, section, - psymbol_placement::STATIC, + psymbol_placement::GLOBAL, unrelocated_addr (0), language_c, ccp->partial_symtabs, ccp->of); diff --git a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp index 7c6cb0d3bf14759f3fa40ab3926b0da8d7988dac..06242d3e74d4c8586826460d46266cb25406aa68 100644 --- a/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp +++ b/gdb/testsuite/gdb.ctf/cross-tu-cyclic.exp @@ -37,6 +37,6 @@ gdb_test_no_output "set always-read-ctf on" gdb_load $binfile # Same thing with struct and union. -gdb_test "ptype struct A" "type = struct A \{\[\r\n\]+\[ \t\]+struct B \\*foo;\[\r\n\]+\}.*" "ptype structure A" -gdb_test "ptype struct B" "type = struct B \{\[\r\n\]+\[ \t\]+struct B \\*next;\[\r\n\]+\}.*" "ptype structure B" +gdb_test "ptype struct A" "type = struct A \{\[\r\n\]+\[ \t\]+long a;\[\r\n\]+\[ \t\]+struct B \\*foo;\[\r\n\]+\}.*" "ptype structure A" +gdb_test "ptype struct B" "type = struct B \{\[\r\n\]+\[ \t\]+int foo;\[\r\n\]+\[ \t\]+struct A \\*bar;\[\r\n\]+\}.*" "ptype structure B" gdb_test "ptype struct C" "type = struct C \{\[\r\n\]+\[ \t\]+struct B \\*foo;\[\r\n\]+\[ \t\]+int b;\[\r\n\]+\}.*" "ptype structure C" -- 2.46.1