This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: addr2line seems slow


Patrick Doyle <doylep@eecg.toronto.edu> writes:

> To convert 34,000 addresses to line numbers, addr2line takes upwards of
> four minutes.  That's longer than I would have expected.
> 
> Poking around the source, I found that it calls
> "bfd_find_nearest_line" for each address.  Presumably that does a linear
> search through the debug information?
> 
> Has anyone considered caching these values once they are computed?  Or
> perhaps sorting the bfd data so a more efficient search can be performed?

The behaviour of bfd_find_nearest_line differs from different object
file formats.  You didn't mention which format you were using.

For some object file formats, bfd_find_nearest_line caches the values.
For some, it sorts the data and does a lookup for each call.  For
others, it does a linear search through the debugging information.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]