addr2line seems slow
Ian Lance Taylor
ian@zembu.com
Sun Jul 29 10:15:00 GMT 2001
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
More information about the Binutils
mailing list