aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-06-24 21:23:12 +0700
committerMike Frysinger <vapier@gentoo.org>2015-06-24 10:25:38 -0400
commit87d1b30944783ae0efb49236c6d872d775a37417 (patch)
tree3e990e8add8a7527ca4b6c2c70779bc4541e3c8d /gdb/remote-sim.c
parent8371bf0cd99635c9eabed28481b34ea8934a948e (diff)
downloadgdb-87d1b30944783ae0efb49236c6d872d775a37417.zip
gdb-87d1b30944783ae0efb49236c6d872d775a37417.tar.gz
gdb-87d1b30944783ae0efb49236c6d872d775a37417.tar.bz2
gdb: sim: merge the sysroot update logic together
Initialize the local sysroot fully before we start using it. This keeps it all a bit simpler.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 0c43379..82c129d 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -670,9 +670,13 @@ gdbsim_open (const char *args, int from_tty)
int len;
char *arg_buf;
struct sim_inferior_data *sim_data;
- const char *sysroot = gdb_sysroot;
+ const char *sysroot;
SIM_DESC gdbsim_desc;
+ sysroot = gdb_sysroot;
+ if (is_target_filename (sysroot))
+ sysroot += strlen (TARGET_SYSROOT_PREFIX);
+
if (remote_debug)
fprintf_unfiltered (gdb_stdlog,
"gdbsim_open: args \"%s\"\n", args ? args : "(null)");
@@ -717,8 +721,6 @@ gdbsim_open (const char *args, int from_tty)
}
/* Pass along gdb's concept of the sysroot. */
strcat (arg_buf, " --sysroot=");
- if (is_target_filename (sysroot))
- sysroot += strlen (TARGET_SYSROOT_PREFIX);
strcat (arg_buf, sysroot);
/* finally, any explicit args */
if (args)