[PATCH 3/4] Introduce gdb_chdir

Eli Zaretskii eliz@gnu.org
Tue Sep 12 14:53:00 GMT 2017


> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Cc: Pedro Alves <palves@redhat.com>,	Sergio Durigan Junior <sergiodj@redhat.com>
> Date: Tue, 12 Sep 2017 00:23:24 -0400
> 
> In order to be able to change the inferior's directory before its
> execution, it is necessary to perform a tilde expansion of the
> directory provided by the user and then chdir into the resulting dir.
> This is what gdb_chdir does.
> 
> Unfortunately it is not possible to use "tilde_expand" from readline
> because this is common code and gdbserver doesn't use readline.  For
> that reason I decided to go with "glob" and its GNU extension,
> GLOB_TILDE.  With the import of the "glob" module from gnulib, this is
> a no-brainer.

Why not simply 'getenv("HOME")'?



More information about the Gdb-patches mailing list