From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 946 invoked by alias); 9 Jun 2011 14:24:41 -0000 Received: (qmail 937 invoked by uid 22791); 9 Jun 2011 14:24:39 -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; Thu, 09 Jun 2011 14:24:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C0CC52BB522; Thu, 9 Jun 2011 10:24:24 -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 vGNiX8BLpDDV; Thu, 9 Jun 2011 10:24:24 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6AE682BB504; Thu, 9 Jun 2011 10:24:24 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id ABFA6145615; Thu, 9 Jun 2011 07:24:21 -0700 (PDT) Date: Thu, 09 Jun 2011 14:24:00 -0000 From: Joel Brobecker To: Tristan Gingold Cc: Mike Frysinger , gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Subject: Re: [PATCH] gdb: sim: automatically pass down sysroot Message-ID: <20110609142421.GF12834@adacore.com> References: <1306440200-25087-1-git-send-email-vapier@gentoo.org> <20110608164939.GA14178@adacore.com> <201106090107.44953.vapier@gentoo.org> <8BCAE08E-3F58-49B3-B822-E3BC2B298C7F@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <8BCAE08E-3F58-49B3-B822-E3BC2B298C7F@adacore.com> 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/msg00132.txt.bz2 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 349 > > 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 --NzB8fVQJ5HfG6fxh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sim-ppc.diff" Content-length: 1435 commit 1f192d6b369336703e07d74833f98a8bdc6c3361 Author: Joel Brobecker 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 + + * psim.c (psim_options): Fix length of comparison when checking + for --sysroot= option. + 2011-06-08 Joel Brobecker * 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) --NzB8fVQJ5HfG6fxh--