From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21436 invoked by alias); 26 May 2011 20:03:39 -0000 Received: (qmail 21414 invoked by uid 22791); 26 May 2011 20:03:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 May 2011 20:03:23 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 727451B4004; Thu, 26 May 2011 20:03:21 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: toolchain-devel@blackfin.uclinux.org Subject: [PATCH] gdb: sim: automatically pass down sysroot Date: Thu, 26 May 2011 20:03:00 -0000 Message-Id: <1306440200-25087-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00621.txt.bz2 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 2011-05-26 Mike Frysinger * 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