From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59712 invoked by alias); 1 Sep 2017 12:32:49 -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 59703 invoked by uid 89); 1 Sep 2017 12:32:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:123, H*F:D*be, UD:be, philippe X-HELO: mailsec112.isp.belgacom.be Received: from mailsec112.isp.belgacom.be (HELO mailsec112.isp.belgacom.be) (195.238.20.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Sep 2017 12:32:42 +0000 Received: from 35.138-247-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.247.138.35]) by relay.skynet.be with ESMTP/TLS/AES128-GCM-SHA256; 01 Sep 2017 14:32:39 +0200 Message-ID: <1504269215.1537.123.camel@skynet.be> Subject: Re: [PATCH/RFC] Implement the ability to set the current working directory in GDBserver From: Philippe Waroquiers To: Sergio Durigan Junior Cc: Eli Zaretskii , gdb-patches@sourceware.org, palves@redhat.com Date: Fri, 01 Sep 2017 12:32:00 -0000 In-Reply-To: <8737875sbb.fsf@redhat.com> References: <20170830043811.776-1-sergiodj@redhat.com> <83bmmx2kpq.fsf@gnu.org> <8737875sbb.fsf@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00006.txt.bz2 On Thu, 2017-08-31 at 17:40 -0400, Sergio Durigan Junior wrote: > >> + This is done by using the "cd" command in GDB, which instructs it > >> + to tell GDBserver about this directory change the next time an > >> + inferior is run. If you want to make GDBserver enter the > >> + directory your GDB is currently in, you can do a "cd ." in GDB. > > > > Couldn't GDB do this "cd ." step under the hood, without bothering > > users with that? > > The problem is that we don't really know if the user will want to change > gdbserver's current directory or not. If we always assume so, this will > lead to many breakages as the directory tree will not be always the same > on host and target. That's why 'user_set_cwd' is initially false. > However, there's the case when the user may want to change gdbserver's > directory to the same directory GDB is in. That's why I included this > explanation in the docs. > > The more I think about this, the less I'm satisfied with the current > solution. But I can't really think of a better alternative that doesn't > involve having a separate command to manipulate gdbserver's cwd. Why not have options such as: cd -s xxxx only change the gdb server directory cd -g xxxx only change the gdb directory cd xxxx change both gdb and gdb server directory (synonym of cd -s -g xxxx) Philippe