Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
Subject: Re: [PATCH] gdb: sim: automatically pass down sysroot
Date: Wed, 08 Jun 2011 16:50:00 -0000	[thread overview]
Message-ID: <20110608164939.GA14178@adacore.com> (raw)
In-Reply-To: <1306440200-25087-1-git-send-email-vapier@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 847 bytes --]

> 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".

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

[-- Attachment #2: sim-ppc-sysroot-option.diff --]
[-- Type: text/x-diff, Size: 1488 bytes --]

commit df31576192c6a95c3a56583d7de54a452dd52110
Author: Joel Brobecker <brobecker@adacore.com>
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  <brobecker@adacore.com>
+
+	* psim.c (psim_options): Accept and ignore `--sysroot=...'.
+
 2011-06-03  Joel Brobecker  <brobecker@adacore.com>  (obvious fix)
 
 	From Stephen Kitt  <steve@sk2.org>
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[];

  parent reply	other threads:[~2011-06-08 16:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26 20:03 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110608164939.GA14178@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=toolchain-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox