This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] delete lookup_symbol_aux_minsyms
- From: David Carlton <carlton at math dot stanford dot edu>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com, Elena Zannoni <ezannoni at redhat dot com>, Jim Blandy <jimb at redhat dot com>
- Date: 24 Feb 2003 10:03:55 -0800
- Subject: Re: [rfa] delete lookup_symbol_aux_minsyms
- References: <ro1el605bwf.fsf@jackfruit.Stanford.EDU><20030222205011.GA25494@nevyn.them.org>
On Sat, 22 Feb 2003 15:50:11 -0500, Daniel Jacobowitz <drow at mvista dot com> said:
> On Sat, Feb 22, 2003 at 11:54:40AM -0800, David Carlton wrote:
>> So what's the conclusion? Performance considerations don't seem to
>> give a clear answer. So we should go with whatever's cleanest. My
>> recommendation:
>>
>> * Delete the 'else' clause: it might cause correctness problems.
>>
>> * Comment out the remaining part of lookup_symbol_aux_minsyms: if
>> somebody comes up with a situation where we spend lots of time
>> searching for functions that aren't in a loaded symtab, we can
>> consider uncommenting it and adding it back in.
> I'm pretty sure the answer is "none at all" based on skimming the
> code, but what affect does removing lookup_symbol_aux_minsyms have
> when looking for something which turns out not to have debugging
> info? lookup_symbol would fail, so it doesn't matter - is that
> right?
That's right: lookup_symbol tries to find symbols, so if a function
doesn't have debugging info, then lookup_symbol will return NULL
(unless we're in some sort of bizarre situation like having a static
function elsewhere with the same name), at which point it's the
caller's responsibility to call lookup_minimal_symbol if the caller is
in a position to deal with minimal symbols instead of symbols. And
lookup_symbol would have returned NULL either before or after my
patch: the call to 'find_pc_sect_symtab' would have failed.
> I don't know if I like this comment-out-part-delete-part business;
> if we don't want the function, let's kill it.
It's not my first choice, either, but Elena has shown a preference in
the past for commenting out code like this instead of deleting it.
(C.f. the already commented-out bit in lookup_symbol_aux.) This seems
to me a situation where it's not worth arguing about it. However, if
Elena would rather delete it, I'd be happy to go along with that, too.
David Carlton
carlton at math dot stanford dot edu