summaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-25 17:54:55 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-07-23 15:38:54 -0400
commitfd2dec2a45a73154d9824071ebb8664a39a69174 (patch)
tree2297cdb9fa147b25a87d354a0f7e1452f71a64d3 /gdb/infcmd.c
parent90cc31c9e59a75122c2371fdf43f53d91e6ad5d6 (diff)
downloadbinutils-gdb-fd2dec2a45a73154d9824071ebb8664a39a69174.tar.gz
gdb: make inferior::m_args an std::string
With the current code, both a NULL pointer and an empty string can mean "no arguments". We don't need this distinction. Changing to a string has the advantage that there is now a single state for that (an empty string), which makes the code a bit simpler in my opinion. Change-Id: Icdc622820f7869478791dbaa84b4a1c7fec21ced
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index be6031d2936..2d0d6cc3e96 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -129,7 +129,7 @@ set_inferior_args_vector (int argc, char **argv)
{
gdb::array_view<char * const> args (argv, argc);
std::string n = construct_inferior_arguments (args);
- current_inferior ()->set_args (n.c_str ());
+ current_inferior ()->set_args (std::move (n));
}
/* Notice when `set args' is run. */
@@ -151,7 +151,7 @@ show_args_command (struct ui_file *file, int from_tty,
/* Note that we ignore the passed-in value in favor of computing it
directly. */
deprecated_show_value_hack (file, from_tty, c,
- current_inferior ()->args ());
+ current_inferior ()->args ().c_str ());
}
/* See gdbsupport/common-inferior.h. */