From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89117 invoked by alias); 19 Feb 2016 10:24:55 -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 89101 invoked by uid 89); 19 Feb 2016 10:24:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=eyes, rework, Hx-languages-length:1463, Backtrace X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 19 Feb 2016 10:24:52 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A0232C0AD754; Fri, 19 Feb 2016 10:24:50 +0000 (UTC) Received: from blade.nx (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JAOnjm003187; Fri, 19 Feb 2016 05:24:50 -0500 Received: by blade.nx (Postfix, from userid 1000) id 2504F26441D; Fri, 19 Feb 2016 10:24:48 +0000 (GMT) Date: Fri, 19 Feb 2016 10:24:00 -0000 From: Gary Benson To: Pedro Alves Cc: gdb-patches@sourceware.org, Luis Machado Subject: Re: [PATCH] Fix logic in exec_file_locate_attach Message-ID: <20160219102447.GA29870@blade.nx> References: <56BDF92B.50107@redhat.com> <1455815129-14795-1-git-send-email-gbenson@redhat.com> <56C5FF48.3050804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C5FF48.3050804@redhat.com> X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00584.txt.bz2 Pedro Alves wrote: > On 02/18/2016 05:05 PM, Gary Benson wrote: > > * exec.c (exec_file_locate_attach): Throw error if > > exec_file_find fails to locate the main executable. > > This goes back to: > https://sourceware.org/ml/gdb-patches/2016-02/msg00413.html > > Why is this an error, that even makes us stop the attach process > halfway, if the case when we don't know the file name is completely > silent? : Hmmm, I was trying to fix a test failure, but looking at it with fresh eyes this morning it would've been better to fix up that test as the resulting state is more usable without a throw. This is with throw: (gdb) set sysroot /whatever (gdb) attach 31954 Attaching to process 31954 ../attach-bad-sysroot: in sysroot "/whatever": No such file or directory. (gdb) bt #0 0xb54aca20 in ?? () Backtrace stopped: Cannot access memory at address 0x25ae1df8 (gdb) This is without throw: (gdb) set sysroot /whatever (gdb) attach 31954 Attaching to process 31954 warning: Could not load vsyscall page because no executable was specified try using the "file" command first. 0x00000039b54aca20 in ?? () (gdb) bt #0 0x00000039b54aca20 in ?? () #1 0x00000039b54ac8b0 in ?? () #2 0x0000000000000000 in ?? () (gdb) So without the throw you can backtrace. Also, not throwing will I think fix things for Luis without adding TRY..CATCH in remote.c. I'll rework and resubmit. Cheers, Gary -- http://gbenson.net/