From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88924 invoked by alias); 7 Jun 2015 11:40:39 -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 88911 invoked by uid 89); 7 Jun 2015 11:40:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailrelay110.isp.belgacom.be Received: from mailrelay110.isp.belgacom.be (HELO mailrelay110.isp.belgacom.be) (195.238.20.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 07 Jun 2015 11:40:35 +0000 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=eWtaKQUTUbzTvYESxgzcVvJXO5dQmjbJ/tTWSlQWV0k= c=1 sm=2 a=IkcTkHD0fZMA:10 a=67YvxkRrGnLMvtf8WbIA:9 a=QEXdDO2ut3YA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CrAQDuLHRV/xSZgW0NT4dgwF6CVQKBZgEBAQEBAYUuAQEEIwRSEAsOCgICJgICVwaIRatpcKM7AQEBAQEBAQECAQEBAR6BIYoihQYHgmiBRQEEoAeGeY81gQWBKByBVIM0AQEB Received: from 20.153-129-109.adsl-dyn.isp.belgacom.be (HELO [192.168.1.11]) ([109.129.153.20]) by relay.skynet.be with ESMTP; 07 Jun 2015 13:40:32 +0200 Subject: Re: [PATCH v2] Make only user-specified executable and symbol filenames sticky From: Philippe Waroquiers To: Gary Benson Cc: gdb-patches@sourceware.org, Pedro Alves , Joel Brobecker , Doug Evans , Don Breazeal In-Reply-To: <1433503346-22517-1-git-send-email-gbenson@redhat.com> References: <20150603172339.GA24958@adacore.com> <1433503346-22517-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Sun, 07 Jun 2015 11:40:00 -0000 Message-ID: <1433677265.2933.20.camel@soleil> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00092.txt.bz2 On Fri, 2015-06-05 at 12:22 +0100, Gary Benson wrote: > Built and regtested on RHEL6.6 x86_64. I tested with the last SVN version of the Valgrind gdbserver (that supports qXfer:exec-file:read+). The patch introduces a regression: with the patch, GDB does not anymore automatically load the exec-file. I bypassed this problem by ignoring fake_pid_p in remote.c: --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1624,9 +1624,13 @@ remote_add_inferior (int fake_pid_p, int pid, int attached, inf->attach_flag = attached; inf->fake_pid_p = fake_pid_p; - /* 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) + /* Attempt to open the file that was executed to create this + inferior. If the user has explicitly specified executable + and/or symbol files then warn the user if their choices do + not match. Otherwise, set exec_file and symfile_objfile to + the new file. */ + printf("fake_pid_p %d\n", fake_pid_p); + if (try_open_exec)// && !fake_pid_p) exec_file_locate_attach (pid, 1); Effectively, the printf shows that with Valgrind gdbsrv, fake_pid_p value is 1. When ignoring fake_pid_p, GDB can properly attach to different Valgrind gdbsrv, and changes of executable as expected. Philippe