From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 2F19F3861930 for ; Fri, 27 Oct 2023 18:39:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F19F3861930 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 2F19F3861930 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698431945; cv=none; b=L6uTsRh5KJQW3wTdK5OjZxEAHLqx+nR2hr+T5BbqjxHI9Fmsl7RT8OiUJBVAnc2KIcZFzj1ryRcB/9AeKhYG8U649kDveDTwDCGJ+UKLzsz3A1ChQtgLN8TDDTXaYttQILosOFgsYehJRgOaPkHI+hV5o2sQ0pf03O0G9fCoJ+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698431945; c=relaxed/simple; bh=aNELL/rVKpHiBeB5PjS5DZo/KDjgCpS5buzgm3Aokpg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nNk/Vbq6YulOnvB/rnclkPJcD4h4a6rxcmyUx9INKrSY+3IHqkJ6SIWFu9HdoVQNY6KGq1TcN6Y35yK0BzadifkoTGRqYeVnkcV3cLY8RVwuWVbu1sf6HQnLifjSuQqWGIacQ0ESN68ifLngjU0dqdtWElGf/UImsgq5IB9ImL4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6001a.ext.cloudfilter.net ([10.0.30.140]) by cmsmtp with ESMTPS id wKPEq31dg6nOZwRjbqmBge; Fri, 27 Oct 2023 18:39:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id wRjaqfwp0NUwRwRjaqhAdf; Fri, 27 Oct 2023 18:39:02 +0000 X-Authority-Analysis: v=2.4 cv=I852+fsg c=1 sm=1 tr=0 ts=653c03c6 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=tUe9Xgf9KGOW-Ne-1qwA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: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=Do/fMpVlHuHJAuwmIOsExuCLdwey3WAmmglGdQb3aF8=; b=IVKkBZwT6QsfoVebf12fGsoU89 IKyrn/v7bdTr9vj9uVjjLNnyiwcnzwD8zi2C9RbhDdJhk4g93NQqQs5lhoiLpbFCnjMe9H60h0qY7 pGxDG6lulocH0YYWE7KTY4uVz; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:43524 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1qwRja-002Nsn-07; Fri, 27 Oct 2023 12:39:02 -0600 From: Tom Tromey To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] gdb: fix reopen_exec_file for files with target: prefix References: <8f5ded0b6bac82dcc59fc028aad239012f08bf1a.1698246342.git.aburgess@redhat.com> X-Attribution: Tom Date: Fri, 27 Oct 2023 12:39:01 -0600 In-Reply-To: <8f5ded0b6bac82dcc59fc028aad239012f08bf1a.1698246342.git.aburgess@redhat.com> (Andrew Burgess's message of "Wed, 25 Oct 2023 16:08:18 +0100") Message-ID: <87sf5vlxkq.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 1qwRja-002Nsn-07 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (murgatroyd) [97.122.77.73]:43524 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: MS4xfJhPRsTvw7GeJM/22C8foT9LmDgK0G1JMF4ceWNwagx6Nd80K21+fBj7itMTaUwVJIbVCX1M3WM49tNbOsdMyRV1zQl7aliwRyz0Oi6rTLDOWii5zRO7 dAkyepkUqrJAm8l/AABtDxmhlEQKmtMIBuxK0HOywW1PYC7dh+PZItfmKBgmetoNzG6q0Z1wYOF/ezmrcJgZWYg+cuwnD9Z79VQ= X-Spam-Status: No, score=-3018.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP 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: >>>>> "Andrew" == Andrew Burgess writes: Andrew> @@ -105,21 +105,24 @@ specify_exec_file_hook (void (*hook) (const char *)) Andrew> void Andrew> reopen_exec_file (void) Andrew> { Andrew> - int res; Andrew> - struct stat st; Andrew> - Andrew> /* Don't do anything if there isn't an exec file. */ Andrew> if (current_program_space->exec_bfd () == NULL) Andrew> return; Andrew> + bfd *exec_bfd = current_program_space->exec_bfd (); IMO you might as well hoist this a few lines up and use the local in the NULL check as well. Otherwise I think this looks good. Thank you for doing this. Tom