This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] choose symbol from given block's objfile first.
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 08 May 2012 11:19:02 -0600
- Subject: Re: [RFC] choose symbol from given block's objfile first.
- References: <1336430581-11262-1-git-send-email-brobecker@adacore.com>
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> But I also believe that this is a useful patch, because I think
Joel> that the answer yielded by GDB using this algorithm has more chances
Joel> of returning the symbol that the user actually meant.
I agree. This change would make gdb's behavior less surprising in some
corner cases, and I think it is hard to argue that people know or rely
on gdb's current behavior.
Joel> This is only a prototype at the moment. It fixes the problem while
Joel> not causing any regression with the testsuite. I am wondering about
Joel> the loop over all objfiles callling lookup_symbol_aux_quick. I think
Joel> I would need to apply the same treatment, in case
Joel> lookup_symbol_aux_symtabs doesn't return any match. But I'm not sure
Joel> why I'd need that...
Yes, I think you'd need this change there as well.
gdb should end up in the lookup_symbol_aux_quick loop if the symbol in
question is in an unexpanded psymtab. In this case you want to be sure
to check the block objfile first.
Joel> ALL_OBJFILES_STARTING_WITH
Works for me.
Tom