This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: sim: automatically pass down sysroot


> > here's the fix for erc32.  ok to commit ?
> 
> Is it correct ?  IIRC sizeof ("xxx") == strlen ("xxx") + 1.

You're quite right.  The weird thing is that I had the "- 1"
in my code at some point, I'm sure of that. How it came to
disappear, I'm really puzzled.

Here is what I just checked in to fix the problem on ppc.
Thanks, Tristan.

-- 
Joel
commit 1f192d6b369336703e07d74833f98a8bdc6c3361
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Thu Jun 9 07:18:36 2011 -0700

    sim/ppc: Fix check for --sysroot= option
    
    Fixes an error reported by Tristan and which can be evidenced by
    doing:
    
            % powerpc-elf-gdb
            (gdb) target sim --sysroot=var
            Invalid option: --sysroot=/var
            [...]
    
    sim/ppc/ChangeLog:
    
            * psim.c (psim_options): Fix length of comparison when checking
            for --sysroot= option.

diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 5e6fff6..455585a 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-09  Joel Brobecker  <brobecker@adacore.com>
+
+	* psim.c (psim_options): Fix length of comparison when checking
+	for --sysroot= option.
+
 2011-06-08  Joel Brobecker  <brobecker@adacore.com>
 
 	* psim.c (psim_options): Add option that cause the error
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index d814486..3e76386 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -359,7 +359,7 @@ psim_options(device *root,
 	else if (strcmp (argv[argp], "--help") == 0)
 	  psim_usage (0, 1);
 	else if (strncmp (argv[argp], "--sysroot=",
-			  sizeof ("--sysroot=")) == 0)
+			  sizeof ("--sysroot=") - 1) == 0)
 	  /* Ignore this option.  */
 	  p = argv[argp] + strlen(argv[argp]) - 1;
 	else if (strcmp (argv[argp], "--version") == 0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]