This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/RFC] Implement the ability to set the current working directory in GDBserver
- From: John Baldwin <jhb at freebsd dot org>
- To: gdb-patches at sourceware dot org
- Cc: Pedro Alves <palves at redhat dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>, Eli Zaretskii <eliz at gnu dot org>
- Date: Thu, 31 Aug 2017 15:36:34 -0700
- Subject: Re: [PATCH/RFC] Implement the ability to set the current working directory in GDBserver
- Authentication-results: sourceware.org; auth=none
- References: <20170830043811.776-1-sergiodj@redhat.com> <79779c39-8f54-c5da-5450-e67a35294e08@redhat.com>
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