Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Don Breazeal <donb@codesourcery.com>
Cc: Keith Seitz <keiths@redhat.com>,
		"gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [PING] Re: [PATCH] Fix problem handling colon in linespec, PR breakpoints/18303
Date: Tue, 26 Jan 2016 16:56:00 -0000	[thread overview]
Message-ID: <CADPb22S+SmNi3LV+zOU9hxYCkhAbEWMHMNDsspSPX5Tk8yr38g@mail.gmail.com> (raw)
In-Reply-To: <56A65AD6.8060001@codesourcery.com>

On Mon, Jan 25, 2016 at 9:26 AM, Don Breazeal <donb@codesourcery.com> wrote:
> 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

Sorry, nothing more to add.
Keith's suggestion is fine by me.


  reply	other threads:[~2016-01-26 16:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 22:34 Doug Evans
2016-01-12  0:17 ` Don Breazeal
2016-01-12 18:26 ` Keith Seitz
2016-01-25 17:26   ` [PING] " Don Breazeal
2016-01-26 16:56     ` Doug Evans [this message]
2016-01-28  1:21       ` [PATCH v2] PR 18303, Tolerate malformed input for lookup_symbol-called functions Don Breazeal
2016-01-28 12:06         ` Pedro Alves
2016-01-28 22:43           ` [PATCH v3] " Don Breazeal
2016-01-28 22:52             ` [PATCH v4] " Don Breazeal
2016-02-04 18:37               ` [PING] " Don Breazeal
2016-02-18 18:22                 ` [PING] Re: [PATCH v4] PR 18303, Tolerate malformed input for lookup_symbol-called functions (was: [PATCH] Fix problem handling colon in linespec, PR breakpoints/18303) Don Breazeal
2016-02-25 17:28                   ` [PING] Re: [PATCH v4] PR 18303, Tolerate malformed input for lookup_symbol-called functions Don Breazeal
2016-03-03 18:19                     ` Don Breazeal
2016-03-14 21:23                       ` [PING] Re: [PATCH v4] PR 18303, Tolerate malformed input for lookup_symbol-called functions (was: Re: [PATCH] Fix problem handling colon in linespec, PR breakpoints/18303) Don Breazeal
2016-03-15 15:55                         ` [PING] Re: [PATCH v4] PR 18303, Tolerate malformed input for lookup_symbol-called functions Pedro Alves

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=CADPb22S+SmNi3LV+zOU9hxYCkhAbEWMHMNDsspSPX5Tk8yr38g@mail.gmail.com \
    --to=dje@google.com \
    --cc=donb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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