This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 4/5] Implement "set cwd" command on GDB


On 09/22/2017 09:26 PM, Sergio Durigan Junior wrote:
> On Friday, September 22 2017, Eli Zaretskii wrote:
> 
>>> Cc: gdb-patches@sourceware.org
>>> From: Pedro Alves <palves@redhat.com>
>>> Date: Fri, 22 Sep 2017 20:24:40 +0100
>>>
>>> (gdb) set cwd ~  # I haven't even connected to a target yet.
>>>                  # Where should this be expanded? 
>>>                  # On host may be incorrect.
>>>                  # '~' -> /home/pedro on this machine
>>
>> You can expand it when you connect.  The value has no use until then
>> anyway.
> 
> So you're proposing that we discard the previous path expansion done
> before connecting, right?  I'm just trying to understand your proposal
> here, not to bikeshed or anything.
> 

That would mean keep both non-expanded, and expanded paths around,
which is what I was suggesting with:

 (gdb) set cwd ~foo/bar
 (gdb) show cwd
 The current directory is ~foo/bar (/home/foo/bar)
                                    ^^^^^^^^^^^^^

The (^^^) part was meant to indicate "currently expands to this".

Which means we'd add a new remote packet to request "expand 
this path and give me back the result".

(I think we could do that as a follow up extension.)

But that's not what I understood Eli suggesting.  I understood
it as gdb expanding whatever's the value set on connection.
But I don't see how that could work, because before gdb connects
to a remote target explicitly, it's as if gdb was connected to
the native target (that's how "run" works without typing
"target native" explicitly, though you can type that), so
by the time you connect to the remote target, it's already
too late, gdb has already expanded on the host, and there's
nothing left to expand.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]