aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/server.cc
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-05-25 11:38:53 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-05-25 11:39:11 -0400
commitb69ca137aca2e4aa72f3cad60e0389019ab14116 (patch)
tree6297336c383f19cb7e29c4934dba5ade37128790 /gdbserver/server.cc
parent8c4b5f3d987c80a1746e3f198bb060d7d7671945 (diff)
downloadgdb-b69ca137aca2e4aa72f3cad60e0389019ab14116.zip
gdb-b69ca137aca2e4aa72f3cad60e0389019ab14116.tar.gz
gdb-b69ca137aca2e4aa72f3cad60e0389019ab14116.tar.bz2
gdbserver: Don't add extra NULL to program args
The vector holding the program args is passed as a parameter to target_create_inferior, which then passes it to stringify_argv for all platforms, where any NULL entry in the vector is ignored, so there seems to be no reason to actually add one after all. (Since the intention is to replace uses of stringify_argv with construct_inferior_arguments in a follow-up commit and that function doesn't currently handle such NULL arguments, it would otherwise have to be extended.) gdbserver/ChangeLog: * server.cc (captured_main), (handle_v_run): No longer insert extra NULL element to args vector. Change-Id: Ia2ef6d36814a6b11ce8b0d6e3b33248a7945e825
Diffstat (limited to 'gdbserver/server.cc')
-rw-r--r--gdbserver/server.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 0672f9b..27d0931 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -3015,7 +3015,6 @@ handle_v_run (char *own_buf)
if (*next_p)
next_p++;
}
- new_argv.push_back (NULL);
if (new_program_name == NULL)
{
@@ -3815,7 +3814,6 @@ captured_main (int argc, char *argv[])
program_path.set (make_unique_xstrdup (next_arg[0]));
for (i = 1; i < n; i++)
program_args.push_back (xstrdup (next_arg[i]));
- program_args.push_back (NULL);
/* Wait till we are at first instruction in program. */
target_create_inferior (program_path.get (), program_args);