From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6300 invoked by alias); 8 Jun 2011 16:50:02 -0000 Received: (qmail 6230 invoked by uid 22791); 8 Jun 2011 16:50:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jun 2011 16:49:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DD1222BB44E; Wed, 8 Jun 2011 12:49:44 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XqmLXd2jSXzP; Wed, 8 Jun 2011 12:49:44 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5164D2BB44D; Wed, 8 Jun 2011 12:49:43 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 40554145615; Wed, 8 Jun 2011 09:49:39 -0700 (PDT) Date: Wed, 08 Jun 2011 16:50:00 -0000 From: Joel Brobecker To: Mike Frysinger Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Subject: Re: [PATCH] gdb: sim: automatically pass down sysroot Message-ID: <20110608164939.GA14178@adacore.com> References: <1306440200-25087-1-git-send-email-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <1306440200-25087-1-git-send-email-vapier@gentoo.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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-06/txt/msg00111.txt.bz2 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 847 > 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". It turns out that this is breaking some simulators, at least the ppc sim: % powerpc-elf-gdb (gdb) target sim Unrecognized option The problem is that some sims have their own argument parsing, and they sometimes reject the --sysroot= option. Here is the patch I just checked in to fix the ppc, but I think that other simulators might have the same problem. I checked a few, and I think that the d10v sim, for instance, will also need to be updated). So, we have a decision to make: Either do a pass over all simulators, and fix the ones that need fixing, or revert (in which case my ppc patch also needs to be reverted). -- Joel --BXVAT5kNtrzKuDFl Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sim-ppc-sysroot-option.diff" Content-length: 1488 commit df31576192c6a95c3a56583d7de54a452dd52110 Author: Joel Brobecker Date: Wed Jun 8 09:17:09 2011 -0700 ppc sim: Allow --sysroot command-line option There was a recent change that cuased the "target sim" command to add a --sysroot option to the argument vector passed down to the simulator. This caused a failure in the powerpc simulator, as it did not recognize it. This patch fixes the problem by adding support for the --sysroot option (it ignores it). sim/ppc/ChangeLog: * psim.c (psim_options): Accept and ignore `--sysroot=...'. diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 2b9017a..2536fa4 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,7 @@ +2011-06-08 Joel Brobecker + + * psim.c (psim_options): Accept and ignore `--sysroot=...'. + 2011-06-03 Joel Brobecker (obvious fix) From Stephen Kitt diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c index c311794..076a50c 100644 --- a/sim/ppc/psim.c +++ b/sim/ppc/psim.c @@ -357,6 +357,10 @@ psim_options(device *root, } else if (strcmp (argv[argp], "--help") == 0) psim_usage (0, 1); + else if (strncmp (argv[argp], "--sysroot=", + sizeof ("--sysroot=")) == 0) + /* Ignore this option. */ + p = argv[argp] + strlen(argv[argp]) - 1; else if (strcmp (argv[argp], "--version") == 0) { extern const char version[]; --BXVAT5kNtrzKuDFl--