Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: sim: automatically pass down sysroot
@ 2011-05-26 20:03 Mike Frysinger
  2011-05-26 20:10 ` Marek Polacek
  2011-06-08 16:50 ` Joel Brobecker
  0 siblings, 2 replies; 18+ messages in thread
From: Mike Frysinger @ 2011-05-26 20:03 UTC (permalink / raw)
  To: gdb-patches; +Cc: toolchain-devel

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>

2011-05-26  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".
---
 gdb/remote-sim.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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)
     {
-- 
1.7.5.rc3


^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <1306440200-25087-1-git-send-email-vapier__8251.52545371584$1306440225$gmane$org@gentoo.org>]

end of thread, other threads:[~2011-06-09 15:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 20:03 [PATCH] gdb: sim: automatically pass down sysroot Mike Frysinger
2011-05-26 20:10 ` Marek Polacek
2011-05-26 22:32   ` Mike Frysinger
2011-05-27 17:48   ` Tom Tromey
2011-05-27 17:54     ` Pedro Alves
2011-06-08 16:50 ` Joel Brobecker
2011-06-08 17:08   ` Mike Frysinger
2011-06-08 17:15     ` Joel Brobecker
2011-06-09  5:19   ` Mike Frysinger
2011-06-09  5:48     ` Joel Brobecker
2011-06-09  6:07       ` Mike Frysinger
2011-06-09 14:26         ` Joel Brobecker
2011-06-09  7:29     ` Tristan Gingold
2011-06-09 14:24       ` Joel Brobecker
2011-06-09 15:32         ` Mike Frysinger
2011-06-09  5:19   ` Mike Frysinger
     [not found] <1306440200-25087-1-git-send-email-vapier__8251.52545371584$1306440225$gmane$org@gentoo.org>
2011-05-27 17:47 ` Tom Tromey
2011-05-27 18:37   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox