Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch][python] 2 of 5 - Frame filter MI code changes.
Date: Wed, 13 Mar 2013 19:41:00 -0000	[thread overview]
Message-ID: <5140D644.2010200@redhat.com> (raw)
In-Reply-To: <87ip4vb38v.fsf@fleche.redhat.com>

On 13/03/13 17:48, Tom Tromey wrote:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
> 
>>> I think -stack-list-frames takes "-no-frame-filters" but this and others
>>> take the "--" form.  That seems confusing.
> 
> Phil> They all take the "--" notation
>  
> I think mi_getopt just looks for a single '-'.

I do apologies, I forgot to add the mi-getopt.c patch in with the
patch-set.  Here it is.

Cheers

Phil

--

diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index a1e2ccc..be76ac1 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -29,6 +29,7 @@ mi_getopt (const char *prefix,
 {
   char *arg;
   const struct mi_opt *opt;
+  int olength = 1;
 
   /* We assume that argv/argc are ok.  */
   if (*oind > argc || *oind < 0)
@@ -50,10 +51,15 @@ mi_getopt (const char *prefix,
       *oarg = NULL;
       return -1;
     }
+
+  /* Deal with --foo options.  */
+  if (arg[0] == '-' && arg[1] == '-')
+    olength++;
+
   /* Look the option up.  */
   for (opt = opts; opt->name != NULL; opt++)
     {
-      if (strcmp (opt->name, arg + 1) != 0)
+      if (strcmp (opt->name, arg + olength) != 0)
 	continue;
       if (opt->arg_p)
 	{
@@ -71,7 +77,7 @@ mi_getopt (const char *prefix,
 	  return opt->index;
 	}
     }
-  error (_("%s: Unknown option ``%s''"), prefix, arg + 1);
+  error (_("%s: Unknown option ``%s''"), prefix, arg + olength);
 }
 
 int 



  reply	other threads:[~2013-03-13 19:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 22:13 Phil Muldoon
2013-03-12 20:43 ` Tom Tromey
2013-03-12 20:52   ` Phil Muldoon
2013-03-13 12:15     ` Phil Muldoon
2013-03-13 17:48     ` Tom Tromey
2013-03-13 19:41       ` Phil Muldoon [this message]
2013-03-13 20:27         ` Tom Tromey
2013-03-13 20:53           ` Phil Muldoon
2013-03-13 20:56             ` Tom Tromey
2013-03-13 21:10               ` Phil Muldoon
2013-03-14 17:54                 ` Tom Tromey
2013-03-14 19:35                   ` Phil Muldoon
  -- strict thread matches above, loose matches on Subject: below --
2013-05-06  8:23 Phil Muldoon
2013-05-06 20:42 ` Tom Tromey
2013-05-07  8:23   ` Phil Muldoon
2013-05-07 14:02     ` Tom Tromey
2013-05-08 10:18       ` Phil Muldoon
2013-05-08 19:47         ` Tom Tromey
2013-05-10 10:45           ` Phil Muldoon
2013-04-22 16:01 Phil Muldoon
2013-04-26 11:19 ` Tom Tromey
2012-11-30 14:31 Phil Muldoon
2012-12-05 17:11 ` Tom Tromey
2012-12-07 13:56   ` Phil Muldoon
2012-12-10 21:03     ` Tom Tromey
2013-02-05 12:08       ` Phil Muldoon
2013-02-07 21:32         ` Tom Tromey
2013-02-20 15:17       ` Phil Muldoon
2013-02-20 20:37         ` Tom Tromey

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=5140D644.2010200@redhat.com \
    --to=pmuldoon@redhat.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