gdb: make inferior::m_cwd an std::string

Same idea as the previous patch, but for m_cwd.

To keep things consistent across the board, change get_inferior_cwd as
well, which is shared with GDBserver.  So update the related GDBserver
code too.

Change-Id: Ia2c047fda738d45f3d18bc999eb67ceb8400ce4e
This commit is contained in:
Simon Marchi
2021-06-25 18:07:54 -04:00
parent fd2dec2a45
commit 11bd012ed2
8 changed files with 41 additions and 48 deletions

View File

@@ -32,9 +32,10 @@ extern const char *get_exec_wrapper ();
otherwise return 0 in that case. */
extern const char *get_exec_file (int err);
/* Return the inferior's current working directory. If nothing has
been set, then return NULL. */
extern const char *get_inferior_cwd ();
/* Return the inferior's current working directory.
If it is not set, the string is empty. */
extern const std::string &get_inferior_cwd ();
/* Whether to start up the debuggee under a shell.