From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7540 invoked by alias); 9 Dec 2010 20:42:53 -0000 Received: (qmail 7532 invoked by uid 22791); 9 Dec 2010 20:42:52 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_TG X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Dec 2010 20:42:46 +0000 Received: from eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id oB9LCWce018017; Thu, 9 Dec 2010 15:12:33 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.63]) by eusaamw0707.eamcs.ericsson.se ([147.117.20.32]) with mapi; Thu, 9 Dec 2010 15:42:28 -0500 From: Marc Khouzam To: Tom Tromey CC: "gdb-patches@sourceware.org" Date: Thu, 09 Dec 2010 20:42:00 -0000 Subject: RE: [MI] Wrong error message when parsing invalid --thread-group Message-ID: References: , In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2010-12/txt/msg00118.txt.bz2 From: Tom Tromey [tromey@redhat.com] >>>>> "Marc" =3D=3D Marc Khouzam writes: Marc> 2010-12-07 Marc Khouzam Marc> * mi/mi-parse.c (mi_parse): Wrong error message. Marc> - char *start =3D chp; Marc> + char *option; > Make this "const char *". > > Ok with that change. Thanks! Committed with the "const" change to HEAD and 7_2. Patch below. Marc 2010-12-09 Marc Khouzam * mi/mi-parse.c (mi_parse): Wrong error message. ### Eclipse Workspace Patch 1.0 #P src Index: gdb/mi/mi-parse.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/mi/mi-parse.c,v retrieving revision 1.21.2.1 diff -u -r1.21.2.1 mi-parse.c --- gdb/mi/mi-parse.c 6 Dec 2010 14:23:40 -0000 1.21.2.1 +++ gdb/mi/mi-parse.c 9 Dec 2010 20:31:31 -0000 @@ -292,7 +292,7 @@ to CLI. */ for (;;) { - char *start =3D chp; + const char *option; size_t as =3D sizeof ("--all ") - 1; size_t tgs =3D sizeof ("--thread-group ") - 1; size_t ts =3D sizeof ("--thread ") - 1; @@ -311,6 +311,7 @@ } if (strncmp (chp, "--thread-group ", tgs) =3D=3D 0) { + option =3D "--thread-group"; if (parse->thread_group !=3D -1) error (_("Duplicate '--thread-group' option")); chp +=3D tgs; @@ -321,6 +322,7 @@ } else if (strncmp (chp, "--thread ", ts) =3D=3D 0) { + option =3D "--thread"; if (parse->thread !=3D -1) error (_("Duplicate '--thread' option")); chp +=3D ts; @@ -328,6 +330,7 @@ } else if (strncmp (chp, "--frame ", fs) =3D=3D 0) { + option =3D "--frame"; if (parse->frame !=3D -1) error (_("Duplicate '--frame' option")); chp +=3D fs; @@ -337,8 +340,7 @@ break; =20 if (*chp !=3D '\0' && !isspace (*chp)) - error (_("Invalid value for the '%s' option"), - start[2] =3D=3D 't' ? "--thread" : "--frame"); + error (_("Invalid value for the '%s' option"), option); while (isspace (*chp)) chp++; }