[PATCH] Removing lookup_minimal_symbol_and_objfile

Wei-min Pan weimin.pan@oracle.com
Tue May 29 17:25:00 GMT 2018



On 5/25/2018 6:24 PM, Simon Marchi wrote:
> On 2018-05-14 20:10, Weimin Pan wrote:
>> Removing lookup_minimal_symbol_and_objfile and replacing it with
>> lookup_bound_minimal_symbol. lookup_minimal_symbol_and_objfile
>> only searches ordinary hash table for the minimal symbol entry
>> while lookup_bound_minimal_symbol does both ordinary hash table
>> and demangled hash table for the entry.
>>
>> Tested in both aarch64-linux-gnu and amd64-linux-gnu. No regressions.
>
> Hi Weimin,
>
> Thanks for the patch, the code looks good.  But I think the commit log 
> is misleading.  The point is that lookup_minimal_symbol_and_objfile 
> iterates on all objfiles and calls lookup_minimal_symbol for each of 
> them, effectively searching in all objfiles.  
> lookup_bound_minimal_symbol calls lookup_minimal_symbol with NULL, 
> which also effectively searches all objfiles.  AFAIK, they do exactly 
> the same thing, so we can get rid of one (and 
> lookup_minimal_symbol_and_objfile happens to be the most inefficient 
> because it ends up n^2 on the number of objfiles).
>
> If you are fine with this correction, please push with the commit log 
> adjusted.
>
> Simon

Hi Simon,

I agree with your description which looks better and will use it.

Thanks for your comment.

Weimin



More information about the Gdb-patches mailing list