From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116266 invoked by alias); 12 May 2015 11:03:37 -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 116254 invoked by uid 89); 12 May 2015 11:03:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Tue, 12 May 2015 11:03:35 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4CB3RXH031556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 May 2015 07:03:28 -0400 Received: from blade.nx (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4CB3QZx008496; Tue, 12 May 2015 07:03:27 -0400 Received: by blade.nx (Postfix, from userid 1000) id 9B1D9263CAD; Tue, 12 May 2015 12:03:25 +0100 (BST) Date: Tue, 12 May 2015 11:03:00 -0000 From: Gary Benson To: Pedro Alves Cc: gdb-patches@sourceware.org, Philippe Waroquiers , Eli Zaretskii Subject: Re: [PATCH] Locate executables on remote stubs without multiprocess extensions Message-ID: <20150512110325.GA14668@blade.nx> References: <20150506103145.GA30896@blade.nx> <1430932230-12551-1-git-send-email-gbenson@redhat.com> <20150506171647.GA12725@blade.nx> <5550BEA8.6070602@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5550BEA8.6070602@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00266.txt.bz2 Pedro Alves wrote: > On 05/06/2015 06:16 PM, Gary Benson wrote: > > Gary Benson wrote: > > @@ -11718,7 +11719,15 @@ remote_pid_to_exec_file > > if (filename != NULL) > > xfree (filename); > > > > - xsnprintf (annex, sizeof (annex), "%x", pid); > > + inf = find_inferior_pid (pid); > > + if (inf != NULL && !inf->fake_pid_p) > > This will silently do the wrong thing (retrieve the exec file of > the server's current thread/process) if this method is ever used > to try to fetch the exec out of a process that we're _not_ currently > attached to. Maybe this should be: > > if (inf == NULL) > internal_error (__FILE__, __LINE__, > "attempt to retrieve exec-file of not-debugged process"); > if (!inf->fake_pid_p) Good catch, thanks! > > > @@ -1144,17 +1144,32 @@ handle_qxfer_exec_file [snip] > > > + > > > + if (pid < 0) > > > return -1; > > > > Oops, this should be "<=". > > This is OK with that change and the point above addressed. Ok, I've pushed this, thanks Pedro and Eli for the reviews. Cheers, Gary -- http://gbenson.net/