From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 14F16385ED4B for ; Sun, 18 Feb 2024 01:10:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14F16385ED4B 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 14F16385ED4B 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=1708218615; cv=none; b=W8gVCMx+FEG3HPQbRQE4gpuGUAbp5T9wmFiRKdQteS+Ha2/gOr7CUyoySyWJYPLAtla0aFGtzQSQ3S6aKLvATJ3Oq1OD9r8pcMlyohcIBCU53r7wUyIQS/Z22N/MsVDGwrf123mrlHt2hJ6q4Obw8vZ8AC+kUZp6wv5PYpGsRtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708218615; c=relaxed/simple; bh=lizhWgahU4qLvHYdnrqZQEscYU/2qnRauk+PIUvighM=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=u7FA//xv+DU+2IsiCvxDomSCSnZIG0yyFQjUnUyhImBB168QWfVBmxLIqB4xNTo4YAPV3ApEMWdeHaN/a33YvMYo1FxfC0zydrCFxmpGgEA10XvRx2jyWnF7TMepYQq9SJ9hyUB58OEbTz4S21HKMsjXDVD6zB5S1I489GYK56A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5001a.ext.cloudfilter.net ([10.0.29.139]) by cmsmtp with ESMTPS id bRbyrkaScAxAkbVgzrxkoT; Sun, 18 Feb 2024 01:10:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id bVgzrEAywkGzYbVgzrvmyQ; Sun, 18 Feb 2024 01:10:05 +0000 X-Authority-Analysis: v=2.4 cv=Up/ANPwB c=1 sm=1 tr=0 ts=65d158ed a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=RsZJF8UNYu-G7OIRRzcA: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=WtM6DeFN42thof8PonVhHf6u6YPS4xnI2BQlclBg1aM=; b=J2kva4WXFaKvjiisHvsJMMj0fi CXiSX888alBQH5URISFwEQILllaRkwxHqbaBuhPt+5FnBDnME7GBL8bmmPuBweBNUDs09mh5stqq9 VoXpHdftr0A7b7fj+ZVcs9Ox9; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:49770 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 1rbVgy-003IPy-2U for gdb-patches@sourceware.org; Sat, 17 Feb 2024 18:10:04 -0700 From: Tom Tromey Date: Sat, 17 Feb 2024 18:10:04 -0700 Subject: [PATCH 3/7] Hoist a call to frob_address MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240217-dwarf-race-relocate-v1-3-d3d2d908c1e8@tromey.com> References: <20240217-dwarf-race-relocate-v1-0-d3d2d908c1e8@tromey.com> In-Reply-To: <20240217-dwarf-race-relocate-v1-0-d3d2d908c1e8@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: 71.211.170.195 X-Source-L: No X-Exim-ID: 1rbVgy-003IPy-2U X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net ([192.168.0.21]) [71.211.170.195]:49770 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMaer/DMmvHEU1g9n2cjvNaUhRMzGESAHQq1dE8sqmhZzOjnYTN4zZL8ctXBCwSAao9CS7xLDrRezQb6ybwdBEiULwZE/XpE/V51nrfF5h+ubfwfNuud b7gVv138fkz0AuI9O2oDu/yqIFwL0zWs0czO6WxDQrUSnShKGljRS0x3Z7W4xPmH7uQVxi2A1Ml5wuHPD6klEzsqOPQRnLWlnkY= X-Spam-Status: No, score=-3022.5 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 List-Id: This hoists the call to frob_address in lookup_minimal_symbol_by_pc_section, so that it now appears earlier in the loop. This is useful to help with a refactoring in the next patch. Making this change also made it clear that 'pc' is not used, so this removes the local variable as well. --- gdb/minsyms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/minsyms.c b/gdb/minsyms.c index f63d0f4af61..36ca11a0b94 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -796,7 +796,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio for (objfile *objfile : section->objfile->separate_debug_objfiles ()) { - CORE_ADDR pc = pc_in; + unrelocated_addr unrel_pc; + if (!frob_address (objfile, pc_in, &unrel_pc)) + continue; /* If this objfile has a minimal symbol table, go search it using a binary search. */ @@ -827,9 +829,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio Warning: this code is trickier than it would appear at first. */ - unrelocated_addr unrel_pc; - if (frob_address (objfile, pc, &unrel_pc) - && unrel_pc >= msymbol[lo].unrelocated_address ()) + if (unrel_pc >= msymbol[lo].unrelocated_address ()) { while (msymbol[hi].unrelocated_address () > unrel_pc) { -- 2.43.0