This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 32/40] Make "break foo" find "A::foo", A::B::foo", etc. [C++ and wild matching]
- From: Keith Seitz <keiths at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Mon, 27 Nov 2017 16:39:19 -0800
- Subject: Re: [PATCH 32/40] Make "break foo" find "A::foo", A::B::foo", etc. [C++ and wild matching]
- Authentication-results: sourceware.org; auth=none
- References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-33-git-send-email-palves@redhat.com> <024edecc-7bfa-08a4-de46-3536297f0654@redhat.com> <943402c5-0bbb-8ff7-66e3-5522256fbc1e@redhat.com> <3692eedd-6f0f-2c6b-535c-2c5682dc938e@redhat.com>
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