aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 5bedc04..5bfce2a 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -680,10 +680,9 @@ gdbsim_target_open (const char *args, int from_tty)
int len;
char *arg_buf;
struct sim_inferior_data *sim_data;
- const char *sysroot;
SIM_DESC gdbsim_desc;
- sysroot = gdb_sysroot;
+ const std::string &sysroot = gdb_sysroot;
if (is_target_filename (sysroot))
sysroot += strlen (TARGET_SYSROOT_PREFIX);
@@ -704,7 +703,7 @@ gdbsim_target_open (const char *args, int from_tty)
len = (7 + 1 /* gdbsim */
+ strlen (" -E little")
+ strlen (" --architecture=xxxxxxxxxx")
- + strlen (" --sysroot=") + strlen (sysroot) +
+ + strlen (" --sysroot=") + sysroot.length () +
+ (args ? strlen (args) : 0)
+ 50) /* slack */ ;
arg_buf = (char *) alloca (len);
@@ -731,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);
+ strcat (arg_buf, sysroot.c_str ());
/* finally, any explicit args */
if (args)
{