This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb: sim: merge the sysroot update logic together
- From: Michael Frysinger <vapier at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 24 Jun 2015 14:26:42 -0000
- Subject: [binutils-gdb] gdb: sim: merge the sysroot update logic together
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=87d1b30944783ae0efb49236c6d872d775a37417
commit 87d1b30944783ae0efb49236c6d872d775a37417
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 24 21:23:12 2015 +0700
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.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/remote-sim.c | 8 +++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f46a620..19144ed 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
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.
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)