From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52265 invoked by alias); 31 Aug 2017 22:42:22 -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 52212 invoked by uid 89); 31 Aug 2017 22:42:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Aug 2017 22:42:20 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 189B710AF2A; Thu, 31 Aug 2017 18:42:19 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: Pedro Alves , Sergio Durigan Junior , Eli Zaretskii Subject: Re: [PATCH/RFC] Implement the ability to set the current working directory in GDBserver Date: Thu, 31 Aug 2017 22:42:00 -0000 Message-ID: <1889307.QhulF7yUgy@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <79779c39-8f54-c5da-5450-e67a35294e08@redhat.com> References: <20170830043811.776-1-sergiodj@redhat.com> <79779c39-8f54-c5da-5450-e67a35294e08@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00556.txt.bz2 On Friday, September 01, 2017 12:01:51 AM Pedro Alves wrote: > On 08/30/2017 06:38 AM, Sergio Durigan Junior wrote: > > I didn't want to implement a gdbserver-specific command (e.g., "set > > remote directory"), which means that my approach has some drawbacks. > > For example, if you want gdbserver to cd to "/abc", but "/abc" doesn't > > exist in the host, then you still won't be able to do this, because > > GDB obviously won't allow you to "cd" into a non-existing dir. So you > > will have to have the same directory structure in both host and target > > if you want to do that. > > I'm not sure this is the right approach. I'd like to have a > better understanding of what are the use cases "cd" is used for. > Beyond affecting the inferior's cwd when it is started, what > else is/can "cd" used for? Or IOW, what else does GDB's > current working directory affect? I often use 'cd' to source gdb script files that themselves source additional files. In particular, I have a set of scripts I use for kernel debugging on FreeBSD that live in a 'gdb6' top-level script that itself sources machine-dependent scripts (e.g. 'gdb6.amd64'). To make this work I do 'cd /path/to/scripts' before 'source gdb6'. That may be a bit of an odd ball case, but it would not be relevant to a remote target. -- John Baldwin