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]

[PATCH v2 0/5] New "set cwd" command


Changes from v1:

- The patch is now importing the "getcwd" module from gnulib as well
  as the "glob" one.

- Improved the "gdb_dirbuf removal" patch (patch #2) by making use of
  "getcwd (NULL, 0)" instead of a fixed-length buffer to be passed to
  "getcwd".

- Fixed and improved a few things on the "gdb_chdir patch" (patch #3),
  mainly the "expand_path" function name (which is now named
  "gdb_tilde_expand"), and the lack of a RAII wrapper around "glob" to
  make things exception-safe.  I decided not to use "gdb_tilde_expand"
  globally on GDB for now; there are just too many places that use it
  and I prefer to make this conversion later.

- Added gdbserver changes (patch #5), which hopefully makes it easier
  to see the feature in the "bigger picture".


This patch series is a followup of the discussion that happened at:

  https://sourceware.org/ml/gdb-patches/2017-09/msg00160.html

It implements a new GDB command, "set cwd", which is used to set the
current working directory of the inferior that will be started.  This
command works for both native and remote debugging scenarios.

The idea here is that "set cwd" will become the de facto way of
setting the inferior's cwd.  Currently, the user can use "cd" for
that, but there are side effects: with "cd", GDB also switches to
another directory, and that can impact the loading of scripts and
other files.  With "set cwd", we separate the logic into a new
command.

To maintain backward compatibility, if the user issues a "cd" command
but doesn't use "set cwd", then the inferior's cwd will still be
changed according to what the user specified.  However, "set cwd" has
precedence over "cd", so it can always be used to override it.



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