Re: [PATCH 32/40] Make "break foo" find "A::foo", A::B::foo", etc. [C++ and wild matching]

Keith Seitz
2017-11-28T00:39:23Z

On 11/24/2017 08:48 AM, Pedro Alves wrote:
>
> So I took your suggestion and ran with it. And in the end
> I like it! See more below.

Wow! Bored? ;-)

> On 11/22/2017 04:48 PM, Pedro Alves wrote:
>
> ... well, I'll be d*mn+d... I gave your suggestion a try, and
> I actually like it! If we make "-qualified" a flag instead of an
> option with an argument, then usual case of:
>
> (gdb) b -q A::doit
>
> works the exact same. It's only when you specify source files
> and labels that it makes a difference. So with your suggestion,
> we get a lot of benefit (works with linespecs, which is the common
> case, I guess) with only a mild downside (a little more typing in
> the explicit location case).

Yeah, linespecs are definitely still the primary interface to locations. I
agree, a little more (or even a little more careful) typing for explicit
locations is not much of a big deal. At least not to me.

> Here's what the delta patch looks like. I left "-qualified"
> as an explicit location option, rather than splitting the parsing
> of "qualified" and the real explicit options, because this way
> support for "-qualified" in the middle of other options
> "-source filename.cc -qualified -function func" falls out
> naturally.

I hadn't thought of that. That's a reasonable approach.

> gdb/ax-gdb.c | 3 +-
> gdb/breakpoint.c | 23 +++++++------
> gdb/completer.c | 39 +++++++++++++++++----
> gdb/guile/scm-breakpoint.c | 6 ++--
> gdb/linespec.c | 31 +++++++++++------
> gdb/linespec.h | 3 +-
> gdb/location.c | 86 ++++++++++++++++++++++++++++++----------------
> gdb/location.h | 35 ++++++++++++++-----
> gdb/mi/mi-cmd-break.c | 3 +-
> gdb/python/py-breakpoint.c | 3 +-
> gdb/python/python.c | 3 +-
> 11 files changed, 163 insertions(+), 72 deletions(-)

Looks good!

Thank you,
Keith