From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32793 invoked by alias); 25 Jan 2016 17:26:58 -0000 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 Received: (qmail 32783 invoked by uid 89); 25 Jan 2016 17:26:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=permissive, documentary, degree, watch X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Jan 2016 17:26:56 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aNkui-00024a-R6 from Don_Breazeal@mentor.com ; Mon, 25 Jan 2016 09:26:52 -0800 Received: from [172.30.10.53] (147.34.91.1) by SVR-ORW-FEM-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 25 Jan 2016 09:26:52 -0800 Subject: [PING] Re: [PATCH] Fix problem handling colon in linespec, PR breakpoints/18303 To: Doug Evans References: <047d7b6d967a74c69a0529168b2e@google.com> <56954538.1030007@redhat.com> CC: Keith Seitz , "gdb-patches@sourceware.org ml" From: Don Breazeal Message-ID: <56A65AD6.8060001@codesourcery.com> Date: Mon, 25 Jan 2016 17:26:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56954538.1030007@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00628.txt.bz2 On 1/12/2016 10:26 AM, Keith Seitz wrote: > On 01/11/2016 02:34 PM, Doug Evans wrote: >> > - a complete test, just cheap and documentary. */ >> > - if (strchr (name, '<') == NULL && strchr (name, '(') == NULL) >> > - gdb_assert (strchr (name, ':') == NULL); >> > - >> >> Heya. >> >> The assert is intended to catch (some) violations of this >> (from the function comment): >> >> NAME is guaranteed to not have any scope (no "::") in its name, though >> if for example NAME is a template spec then "::" may appear in the >> argument list. > [snip] >> On that I'm kinda ambivalent, but I like having the assert >> watch for the stated invariant. >> >> Thoughts? > > I missed that comment. [Well, I didn't even look at it. I'm so used to > seeing no/minimal comments for symbol searching functions that I seldom > even look for them. My bad.] > > That seems like a reasonable assertion, then, as long as it really does > test what it is supposed to. How about: > > if (strchr (name, '<') == NULL && strchr (name, '(') == NULL) > gdb_assert (strstr (name, "::") == NULL); > > Or something like that? > >> > diff --git a/gdb/cp-support.c b/gdb/cp-support.c >> > index df127c4..a71c6ad 100644 >> > --- a/gdb/cp-support.c >> > +++ b/gdb/cp-support.c >> > @@ -1037,8 +1037,13 @@ cp_find_first_component_aux (const char *name, >> > int permissive) >> > return strlen (name); >> > } >> > case '\0': >> > - case ':': >> > return index; >> > + case ':': >> > + /* ':' marks a component iff the next character is also a ':'. >> > + Otherwise it is probably malformed input. */ >> > + if (name[index + 1] == ':') >> > + return index; >> > + break; >> >> What if name[index+2] is also ':'? :-) >> > > I don't think that matters at all. It isn't the scope operator in C++ > unless it is *two* colons. Not just a single colon. [Note that I believe > we are going to have to deal with the general single-colon issue when > running this code with abitags, but that's a patch for some other time. > Or maybe this patch already mitigates that to a degree. I haven't > checked into it at all.] > > Keith > Hi Doug, any thoughts on earlier responses from Keith and me to your comments on this issue? Thanks --Don