From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105187 invoked by alias); 1 Apr 2015 14:16:27 -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 105177 invoked by uid 89); 1 Apr 2015 14:16:26 -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; Wed, 01 Apr 2015 14:16:25 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t31EGOXH024584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 1 Apr 2015 10:16:24 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t31EGMrY028299; Wed, 1 Apr 2015 10:16:23 -0400 Message-ID: <551BFDB6.1090302@redhat.com> Date: Wed, 01 Apr 2015 14:16:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson CC: gdb-patches@sourceware.org Subject: Re: [PATCH 7/9] Update exec_file_attach to cope with "target:" filenames References: <1426870087-32654-1-git-send-email-gbenson@redhat.com> <1426870087-32654-8-git-send-email-gbenson@redhat.com> <551BE12D.1080300@redhat.com> <20150401135525.GE655@blade.nx> In-Reply-To: <20150401135525.GE655@blade.nx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00049.txt.bz2 On 04/01/2015 02:55 PM, Gary Benson wrote: > Pedro Alves wrote: >> On 03/20/2015 04:48 PM, Gary Benson wrote: >>> This commit adds support for filenames prefixed with "target:" to >>> exec_file_attach. This is required to correctly follow inferior >>> exec* calls when a gdb_sysroot prefixed with "target:" is set. >> >> Hmm, I don't see how. Isn't this only true when target_pid_to_exec_file >> prepends the sysroot, which it doesn't yet? I think this should move >> to that other series. > > Search for gdb_sysroot in infrun.c. Ah, thanks. I went from memory (which obviously failed), while I should have looked. > >> A couple bits could use more explanation (in commit log and/or >> comments): >> >> - Why is writing into executable files not supported with "target:" ? >> - The skipping of gdb_realpath_keepfile. > > Are these two additions ok? Yes, thanks. BTW, looking again at the patch I noticed a spurious new line: > + { > + > + scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, Patch is OK with those fixed. > > diff --git a/gdb/exec.c b/gdb/exec.c > index 6b6fc7d..ce61303 100644 > --- a/gdb/exec.c > +++ b/gdb/exec.c > @@ -192,6 +192,7 @@ exec_file_attach (const char *filename, int from_tty) > > if (load_via_target) > { > + /* gdb_bfd_fopen does not support "target:" filenames. */ > if (write_files) > warning (_("writing into executable files is " > "not supported for %s sysroots"), That's a limitation that can be lifted later, by either teaching gdb_bfd_fopen about "target:" or using an alternative like gdb_bfd_open instead, right? Thanks, Pedro Alves