From 11bd012ed256688f43d71dcc531c2f105a9c55dd Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 25 Jun 2021 18:07:54 -0400 Subject: 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 --- gdbserver/server.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdbserver/server.cc') diff --git a/gdbserver/server.cc b/gdbserver/server.cc index 32dcc05..193c3d9 100644 --- a/gdbserver/server.cc +++ b/gdbserver/server.cc @@ -949,17 +949,17 @@ handle_general_set (char *own_buf) { std::string path = hex2str (p); - set_inferior_cwd (path.c_str ()); - if (remote_debug) debug_printf (_("[Set the inferior's current directory to %s]\n"), path.c_str ()); + + set_inferior_cwd (std::move (path)); } else { /* An empty argument means that we should clear out any previously set cwd for the inferior. */ - set_inferior_cwd (NULL); + set_inferior_cwd (""); if (remote_debug) debug_printf (_("\ -- cgit v1.1