From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9300 invoked by alias); 16 Mar 2011 06:59:44 -0000 Received: (qmail 9289 invoked by uid 22791); 16 Mar 2011 06:59:42 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 16 Mar 2011 06:59:33 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2G6xVDO006402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 16 Mar 2011 02:59:31 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2G6xU19026034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Mar 2011 02:59:31 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p2G6xTkR003766; Wed, 16 Mar 2011 07:59:29 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p2G6xTrt003765; Wed, 16 Mar 2011 07:59:29 +0100 Date: Wed, 16 Mar 2011 08:28:00 -0000 From: Jan Kratochvil To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [patch 0/3] Re: [RFA] c++/11734 revisited (and c++/12273) Message-ID: <20110316065928.GA3316@host1.jankratochvil.net> References: <20110227211637.GA18378@host1.dyn.jankratochvil.net> <4D6D6C74.8080304@redhat.com> <20110313222824.GA24322@host1.jankratochvil.net> <4D7FB469.9080703@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D7FB469.9080703@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-03/txt/msg00833.txt.bz2 Hi Keith, On Tue, 15 Mar 2011 19:48:09 +0100, Keith Seitz wrote: > Hi, Jan, thank you for taking the time to look at this. Believe me > when I say, I feel for ya! fortunately it seems this part of linespec is done. > Thanks again for looking at this. FWIW, I've attached only the > linespec patch which includes the requested changes. I guess there should have been a ChangeLog for FSF patch reviews compliance but I am fine with it as is. > +static char * > +keep_name_info (char *ptr) > +{ > + char *p = ptr; > + char *start = ptr; > + > + /* Keep any template parameters. */ > + if (name_end (ptr)) > + goto done; > + > + while (isspace (*p)) > + ++p; > + if (*p == '<') > + ptr = p = find_template_name_end (ptr); > + > + if (name_end (ptr)) > + goto done; > + > + /* Keep method overload information. */ > + if (*p == '(') > + ptr = p = find_method_overload_end (p); > + > + if (name_end (ptr)) > + goto done; > + > + /* Keep important keywords. */ > + while (isspace (*p)) > + ++p; > + if (strncmp (p, "const", 5) == 0 > + && (isspace (p[5]) || p[5] == '\0' > + || strchr (get_gdb_completer_quote_characters (), p[5]) != NULL)) > + ptr = p = p + 5; > + > + done: > + while (ptr > start && isspace (*(ptr - 1))) ptr[-1] > + --ptr; > + return ptr; > +} I see now the goto is in fact not any win here. static const char * remove_tail_spaces (const char *start, const char *s) { while (s > start && isspace (s[-1])) s--; return s; } ... if (name_end (ptr)) return remove_tail_spaces (start, ptr); So asking for this change if I haven't missed anything and a check-in. Thanks, Jan