Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Marc Khouzam <marc.khouzam@ericsson.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [MI] Wrong error message when parsing invalid --thread-group
Date: Thu, 09 Dec 2010 20:42:00 -0000	[thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC572E0C0E04@EUSAACMS0703.eamcs.ericsson.se> (raw)
In-Reply-To: <m34oam3g5t.fsf@fleche.redhat.com>

From: Tom Tromey [tromey@redhat.com]

>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:

Marc> 2010-12-07  Marc Khouzam  <marc.khouzam@ericsson.com>
Marc>   * mi/mi-parse.c (mi_parse): Wrong error message.

Marc> -      char *start = 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  <marc.khouzam@ericsson.com>

	* mi/mi-parse.c (mi_parse): Wrong error message.


### Eclipse Workspace Patch 1.0
#P src
Index: gdb/mi/mi-parse.c
===================================================================
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 = chp;
+      const char *option;
       size_t as = sizeof ("--all ") - 1;
       size_t tgs = sizeof ("--thread-group ") - 1;
       size_t ts = sizeof ("--thread ") - 1;
@@ -311,6 +311,7 @@
         }
       if (strncmp (chp, "--thread-group ", tgs) == 0)
        {
+         option = "--thread-group";
          if (parse->thread_group != -1)
            error (_("Duplicate '--thread-group' option"));
          chp += tgs;
@@ -321,6 +322,7 @@
        }
       else if (strncmp (chp, "--thread ", ts) == 0)
        {
+         option = "--thread";
          if (parse->thread != -1)
            error (_("Duplicate '--thread' option"));
          chp += ts;
@@ -328,6 +330,7 @@
        }
       else if (strncmp (chp, "--frame ", fs) == 0)
        {
+         option = "--frame";
          if (parse->frame != -1)
            error (_("Duplicate '--frame' option"));
          chp += fs;
@@ -337,8 +340,7 @@
        break;
 
       if (*chp != '\0' && !isspace (*chp))
-       error (_("Invalid value for the '%s' option"),
-              start[2] == 't' ? "--thread" : "--frame");
+       error (_("Invalid value for the '%s' option"), option);
       while (isspace (*chp))
        chp++;
     }


      reply	other threads:[~2010-12-09 20:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08  1:24 Marc Khouzam
2010-12-08 16:35 ` Tom Tromey
2010-12-08 16:53   ` Marc Khouzam
2010-12-09 19:22     ` Tom Tromey
2010-12-09 20:42       ` Marc Khouzam [this message]

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=F7CE05678329534C957159168FA70DEC572E0C0E04@EUSAACMS0703.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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