2015-06-24 Mike Frysinger <vapier@gentoo.org>
+ * remote-sim.c (gdbsim_open): Move sysroot update to the top.
+
+2015-06-24 Mike Frysinger <vapier@gentoo.org>
+
* remote-sim.c: Include gdb_bfd.h.
(gdbsim_open): Declare new local sysroot pointing to gdb_sysroot.
Skip TARGET_SYSROOT_PREFIX in gdb_sysroot when it is active.
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)");
}
/* 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)