From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3396 invoked by alias); 13 Mar 2013 19:41:10 -0000 Received: (qmail 3231 invoked by uid 22791); 13 Mar 2013 19:41:09 -0000 X-SWARE-Spam-Status: No, hits=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Mar 2013 19:40:55 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2DJetei015880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Mar 2013 15:40:55 -0400 Received: from localhost.localdomain (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2DJeqHZ016048; Wed, 13 Mar 2013 15:40:54 -0400 Message-ID: <5140D644.2010200@redhat.com> Date: Wed, 13 Mar 2013 19:41:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Tom Tromey CC: "gdb-patches@sourceware.org" Subject: Re: [patch][python] 2 of 5 - Frame filter MI code changes. References: <513E5707.8080404@redhat.com> <87vc8wcpsm.fsf@fleche.redhat.com> <513F9576.30201@redhat.com> <87ip4vb38v.fsf@fleche.redhat.com> In-Reply-To: <87ip4vb38v.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2013-03/txt/msg00605.txt.bz2 On 13/03/13 17:48, Tom Tromey wrote: >>>>>> "Phil" == Phil Muldoon 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