This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 4/5] Implement "set cwd" command on GDB
> 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.
> > Either way IMO is better than expanding at run
> > time, because the latter makes the expansion dependent on factors
> > which could be out of the user control,
>
> I don't see what the problem is here.
>
> > and also requires every use
> > of the value to call gdb_tilde_expand, thus wasting cycles.
>
> I don't think that significant, compared to all the other
> work / syscalls / remote protocol roundtrips that we have
> to do to start a process.
It may be insignificant in terms of CPU usage, but it's a nuisance
that people will keep forgetting to do, as demonstrated in this case.
Anyway, I will shut up now. I just feel that keeping this unexpanded
is wrong in the long run, that's all.