diff options
author | Tom Tromey <tromey@adacore.com> | 2021-10-04 09:14:26 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-10-04 09:14:26 -0600 |
commit | abe19f1119ef3d33acd9c8699ebeb110feed55d8 (patch) | |
tree | c431c46944ded2f3e469c5340e2a3e42e35b6faa /gdb/remote-sim.c | |
parent | 6619a08b25ed618205bb20f9dd069511d60b8df8 (diff) | |
download | gdb-abe19f1119ef3d33acd9c8699ebeb110feed55d8.zip gdb-abe19f1119ef3d33acd9c8699ebeb110feed55d8.tar.gz gdb-abe19f1119ef3d33acd9c8699ebeb110feed55d8.tar.bz2 |
Fix remote-sim.c compilation
The change "make string-like set show commands use std::string
variable" caused remote-sim.c to fail to build. The issue is that the
code does:
const std::string &sysroot = gdb_sysroot;
if (is_target_filename (sysroot))
sysroot += strlen (TARGET_SYSROOT_PREFIX);
... which isn't valid.
This patch changes this code to use a 'const char *' again, fixing the
build.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r-- | gdb/remote-sim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 5bfce2a..3143b42 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -682,7 +682,7 @@ gdbsim_target_open (const char *args, int from_tty) struct sim_inferior_data *sim_data; SIM_DESC gdbsim_desc; - const std::string &sysroot = gdb_sysroot; + const char *sysroot = gdb_sysroot.c_str (); if (is_target_filename (sysroot)) sysroot += strlen (TARGET_SYSROOT_PREFIX); @@ -703,7 +703,7 @@ gdbsim_target_open (const char *args, int from_tty) len = (7 + 1 /* gdbsim */ + strlen (" -E little") + strlen (" --architecture=xxxxxxxxxx") - + strlen (" --sysroot=") + sysroot.length () + + + strlen (" --sysroot=") + strlen (sysroot) + + (args ? strlen (args) : 0) + 50) /* slack */ ; arg_buf = (char *) alloca (len); @@ -730,7 +730,7 @@ gdbsim_target_open (const char *args, int from_tty) } /* Pass along gdb's concept of the sysroot. */ strcat (arg_buf, " --sysroot="); - strcat (arg_buf, sysroot.c_str ()); + strcat (arg_buf, sysroot); /* finally, any explicit args */ if (args) { |