summaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-01 15:29:06 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-01 15:29:06 +0000
commit926e38065f8a9c87981ecb55f08080f677ab2455 (patch)
tree2a804d62c4851e27cde117896595ea8ebbadf843 /gdb/remote-sim.c
parentfbd18a3e2a04a161758f771a64f49e70fbcbd6c4 (diff)
downloadgdb-926e38065f8a9c87981ecb55f08080f677ab2455.tar.gz
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>
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index bf4e0ee715e..918d5cb893a 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)
{