From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i6QYC+mLqWUm5z8AWB0awg (envelope-from ) for ; Thu, 18 Jan 2024 15:36:57 -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=RiE8WK/X; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 20C701E0C3; Thu, 18 Jan 2024 15:36:57 -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 E17411E0C2 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 66B973858292 for ; Thu, 18 Jan 2024 20:36:54 +0000 (GMT) Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 5A5803858CD1 for ; Thu, 18 Jan 2024 20:32:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A5803858CD1 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 5A5803858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609947; cv=none; b=JNzem/8gR8BiqCPRdyvwpbaaJyjc5t9G93mSEdvOY25j6WvRX5X2Yaw8ULLzwuhwXv0/pSzlHsGvWDMeUoL5p8/tq3wi/AYCwJdtFebN/gIGN7f/5oAPVzZulBNGtdTBClLTYMMQCQFV7Gmgj8YoYYc2JZ4+/bsh2u7Xxi+QpoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705609947; c=relaxed/simple; bh=sNPy3xMq3aj/X1OtV0BGbOVO11Q5WbCMCb3cVkVc6XM=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=SpzNArBP/NB6gzzcyaXn6Fwtx6h+DWRg3OY7VcZLhAm5EJZSQSkYJxktRzNGtGc2pQ2gGY2oKz01Jsalhk2pl30WxXb/soc/t34y2pgNUrugUUbKWxmDekzbpbWYi5zIUraW3Y59ZkvbRCkktDr7ic57W/U2I8+t/aFphDYRpkw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5003a.ext.cloudfilter.net ([10.0.29.159]) by cmsmtp with ESMTPS id QYyCr7bw8AxAkQZ3vrR5dz; Thu, 18 Jan 2024 20:32:31 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QZ3errY8Sl5UwQZ3erg4p2; Thu, 18 Jan 2024 20:32:14 +0000 X-Authority-Analysis: v=2.4 cv=daKTYFbe c=1 sm=1 tr=0 ts=65a98ace 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=5czC0i5-_6mFZ_pGFLkA: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=ja94WEoqwbj5eEZ6JI3OG+hXEUss4G/rhRhhSPO/EcM=; b=RiE8WK/XlDK321/EdH2hRAKAIV GOhgC+qmipAzXn9RN3pC/5E/8pV3w4qGGoG9Hqw3x91R9K1Lk10g43cSZOaVEv5ZGpY2N7B+Lh/n2 1s5CLNuF9CDYpUAbyOMbjoGl2; 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 1rQZ3d-002DCj-2Q for gdb-patches@sourceware.org; Thu, 18 Jan 2024 13:32:13 -0700 From: Tom Tromey Date: Thu, 18 Jan 2024 13:32:23 -0700 Subject: [PATCH v2 25/30] Use a function-domain search in inside_main_func MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240118-submit-domain-hacks-2-v2-25-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: 1rQZ3d-002DCj-2Q 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: 27 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJfcZ0r5r1F9KI7fklmsqjqyQjGfIMqBtdfTQGPfNDITteEjjmVe3rPawqBbweoEOQGLGyt7nruXWjRtzYpTWS5Q325kdrYApOjRlQCRLNwUW5Wmw/53 xbLlcJS0gdcA4Y9Xrzr9cHspuVYRgHSEMPjr8fPY+bhnSy3HIZpLnsLyPs2J4/JR7QPUU6WkexR5fB5SxL4mAlApZpgj7OKiQdg= X-Spam-Status: No, score=-3022.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, 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 changes inside_main_func to search only for functions. --- gdb/frame.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gdb/frame.c b/gdb/frame.c index 03f3c50cb8d..7d586eef244 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2560,13 +2560,9 @@ inside_main_func (frame_info_ptr this_frame) symbol with the name of the main function. In this case we should search the full symbols to see if we can find a match. */ struct block_symbol bs = lookup_symbol (name, nullptr, - SEARCH_VFT, nullptr); + SEARCH_FUNCTION_DOMAIN, nullptr); - /* We might have found some unrelated symbol. For example, the - Rust compiler can emit both a subprogram and a namespace with - the same name in the same scope; and due to how gdb's symbol - tables currently work, we can't request the one we'd - prefer. */ + /* This lookup should always yield a block-valued symbol. */ if (bs.symbol != nullptr && bs.symbol->aclass () == LOC_BLOCK) { const struct block *block = bs.symbol->value_block (); -- 2.43.0