This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Reverse order of find_function_symbols/find_method in linespec.c
- From: Doug Evans <dje at google dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 7 Mar 2013 16:32:07 -0800
- Subject: Re: [RFA] Reverse order of find_function_symbols/find_method in linespec.c
- References: <yjt26215phu0.fsf@ruffy2.mtv.corp.google.com> <5137E30C.70207@redhat.com>
On Wed, Mar 6, 2013 at 4:45 PM, Keith Seitz <keiths@redhat.com> wrote:
> On 03/05/2013 03:06 PM, Doug Evans wrote:
>
>> So we can fix the (anonymous namespace)::function case,
>> *and* namespace::class::method (where method is in class and not a
>> baseclass)
>> simply by reversing the order of (1) and (2).
>
>
> Good catch. I think you're absolutely right. Well, that and my philosophy is
> if it doesn't break the test suite, then it's probably okay (at least w.r.t.
> linespecs). I try to be pretty thorough when writing tests for features that
> I've worked implemented.
>
> I only have one small suggestion. With the reorg introduced by your patch,
> we can unconditionally call find_function_symbols on lookup_name and then
> worry about computing class and method names and calling find_method if that
> fails. Finding a scope operator is irrelevant if we found a symbol for
> lookup_name already.
>
> So the call to find_function_symbols can be pushed even further up. I've
> included a slight revision of your patch which does this.
I had to hand apply your patch, I didn't dig into why.
I will check it in in a few days if there are no objections.