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: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sourceware dot org, palves at redhat dot com
- Date: Fri, 01 Sep 2017 14:39:55 -0400
- Subject: Re: [PATCH/RFC] Implement the ability to set the current working directory in GDBserver
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5B842806B3
- References: <20170830043811.776-1-sergiodj@redhat.com> <83bmmx2kpq.fsf@gnu.org> <8737875sbb.fsf@redhat.com> <1504269215.1537.123.camel@skynet.be>
On Friday, September 01 2017, Philippe Waroquiers wrote:
> 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)
That'd be almost similar to having a "set remote cwd" or something.
We'd like to avoid that because the goal here is to unify the
interfaces/features of GDB and gdbserver. If we have two commands, one
for each, it then becomes necessary to treat things differently
internally which ultimately leads to two different versions of the
interfaces.
Not sure if it's clear enough; I can expand more if needed.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/