aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-01 15:29:07 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-01 15:29:07 +0000
commitf4b8c29b8aa1c6a703848c140f2979da17287d45 (patch)
treedd45e693a13e2fbe2c2b13398362f5f049d5107c
parent1706c1994444728a4648cedd3b38947748b9c3bf (diff)
downloadgdb-f4b8c29b8aa1c6a703848c140f2979da17287d45.zip
gdb-f4b8c29b8aa1c6a703848c140f2979da17287d45.tar.gz
gdb-f4b8c29b8aa1c6a703848c140f2979da17287d45.tar.bz2
gdb: sim: automatically pass down sysroot
Since gdb sets up a nice sysroot path for us by default, automatically pass it down to the sim target so it too gets a good default. This does not override anything the user explicitly specifies of course. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/remote-sim.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a560fd5..d5b8781 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-01 Mike Frysinger <vapier@gentoo.org>
+
+ * remote-sim.c (gdbsim_open): Add the strlen of " --sysroot=" and
+ gdb_sysroot to the "len" variable. Append both to "arg_buf".
+
2011-06-01 Yao Qi <yao@codesourcery.com>
* objfiles.h (obj_section_addr): Update reference to objfile from
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index bf4e0ee..918d5cb 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -684,6 +684,7 @@ gdbsim_open (char *args, int from_tty)
len = (7 + 1 /* gdbsim */
+ strlen (" -E little")
+ strlen (" --architecture=xxxxxxxxxx")
+ + strlen (" --sysroot=") + strlen (gdb_sysroot) +
+ (args ? strlen (args) : 0)
+ 50) /* slack */ ;
arg_buf = (char *) alloca (len);
@@ -708,6 +709,9 @@ gdbsim_open (char *args, int from_tty)
strcat (arg_buf, " --architecture=");
strcat (arg_buf, selected_architecture_name ());
}
+ /* Pass along gdb's concept of the sysroot. */
+ strcat (arg_buf, " --sysroot=");
+ strcat (arg_buf, gdb_sysroot);
/* finally, any explicit args */
if (args)
{