From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36441 invoked by alias); 18 Feb 2016 12:40:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 36422 invoked by uid 89); 18 Feb 2016 12:40:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1151 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Feb 2016 12:40:51 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1aWNt2-0002x1-5d from Luis_Gustavo@mentor.com ; Thu, 18 Feb 2016 04:40:48 -0800 Received: from [172.30.2.113] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Thu, 18 Feb 2016 04:40:47 -0800 Reply-To: Luis Machado Subject: Re: [PATCH] Remote debugging without a binary (regression) References: <1455200365-5270-1-git-send-email-lgustavo@codesourcery.com> <20160218123032.GA14534@blade.nx> To: Gary Benson CC: "'gdb-patches@sourceware.org'" From: Luis Machado Message-ID: <56C5BBCA.4030501@codesourcery.com> Date: Thu, 18 Feb 2016 12:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160218123032.GA14534@blade.nx> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00541.txt.bz2 Hi Gary, On 02/18/2016 10:30 AM, Gary Benson wrote: > Hi Luis, > > Luis Machado wrote: >> The following patch guards such a call to prevent those errors >> from disrupting a potential debugging session, and display only >> a warning. > > After looking into this it seems your patch is the right way to > go. There is a separate bug in exec_file_locate_attach in that > in some cases the sysroot is ignored, but fixing that will not > remove the need for what you are proposing. > > My only nit is that I would prefer the TRY-CATCH block smaller, > covering just exec_file_locate_attach, like so: > > /* If no main executable is currently open then attempt to > open the file that was executed to create this inferior. */ > if (try_open_exec && get_exec_file (0) == NULL) > { > /* exec_file_locate_attach may throw an error... > TRY > { > exec_file_locate_attach (pid, 1); > } > CATCH... > > Other than that I am ok with this change. > > Thanks for tracking this down. No problem. I'll come up with a new version of the patch and, while at it, i'll try Pedro's suggestion for the testcase.