From patchwork Tue Nov 21 03:53:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 80410 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B01953858000 for ; Tue, 21 Nov 2023 03:55:28 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id C33E53858409 for ; Tue, 21 Nov 2023 03:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C33E53858409 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 C33E53858409 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=1700538810; cv=none; b=erevqMoArq5NLRHSAq6PsJhlkzCcqYBJNNZEo75h/8dCv1P64xWtemNbBQ7acHOHYYIrTh7eRpnnsADl2kj/AGXbJdqSyZwIayUbZqIZPZmB6CwQ9+NVX+6PsweDrh2ZDvKD48zZxfeCf+087UjLpVflg99jAuxM2cyXTlX7eNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700538810; c=relaxed/simple; bh=l4fLe1FMS/a54Ut+TRTSKviGttoBvCbR/FRKTMioyhk=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=gZj0spCx4c+lvjpfdJCo6T44BJavCQcnMmYo6WqAn2lcvyYVr4Us3RTxwTRQOUcAHPzEc92o4pUltFwYdjKpo+MZ6/XIyhByfFScHOeLo2HaOI6cgHrW9A28qUrCPJ5ayQShxHC6haGd4RR8dtNz/dJtTYLyNhzxoDx4eYFnOTw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id 5Byur80tVKOkL5HpDrTDxO; Tue, 21 Nov 2023 03:53:23 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 5HpCrNHyCBOcc5HpCrSvCS; Tue, 21 Nov 2023 03:53:22 +0000 X-Authority-Analysis: v=2.4 cv=J+25USrS c=1 sm=1 tr=0 ts=655c29b2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=yUApLfCiZwldzDNlM_8A: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=uvAjFcM8sEbQ83wcTlwIqmE0sDYWiEH1T4BdydyasNk=; b=GqvtqbrWfyAgCTOMvG5fmiALpY EeUcgoJvHvt8RBUAHTvK9BRMnUnzItXMbRddjayP6i0JUEt+/UVT0O/mpU1Bh+I8DKM1NEtPs/Xnx gpjbcIy/tHOzPpZzyyazu7m6/; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:47856 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 1r5HpB-0040be-33 for gdb-patches@sourceware.org; Mon, 20 Nov 2023 20:53:21 -0700 From: Tom Tromey Date: Mon, 20 Nov 2023 20:53:55 -0700 Subject: [PATCH 24/29] Use a function-domain search in inside_main_func MIME-Version: 1.0 Message-Id: <20231120-submit-domain-hacks-2-v1-24-29650d01b198@tromey.com> References: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@tromey.com> In-Reply-To: <20231120-submit-domain-hacks-2-v1-0-29650d01b198@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.77.73 X-Source-L: No X-Exim-ID: 1r5HpB-0040be-33 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net ([192.168.0.21]) [97.122.77.73]:47856 X-Source-Auth: tom+tromey.com X-Email-Count: 25 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfL8vl3FzoCOFLRXx/IQaKatdN9C5tNMr8rjhJseT2ouATvv3Rln1lJaB3gMddEdbISPreqIR+H64xmniTxhcAC8ufguRnuOCReK1nUvgratAHt6TYEZG gJY8Fo59dFIv5AF0qF9k++XM161P0P+kLJioa8TBUz049qxcKn4rTZavxgpO+L2s1L8HCj4XRE2NJ7T1Ez2hAkgQf0UL2YxINoA= X-Spam-Status: No, score=-3024.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, 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+patchwork=sourceware.org@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 ce558bf6149..e86299491e2 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2566,13 +2566,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 ();