addr2line seems slow

Ian Lance Taylor ian@zembu.com
Sun Jul 29 23:20:00 GMT 2001


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

> On 29 Jul 2001, Ian Lance Taylor wrote:
> 
> > 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.
> 
> I'm sorry, it's the ELF x86 format.  Do you know what approach it uses for
> that format?

Actually, I forgot to mention another variable.  It depends upon what
sort of debugging information you are using.  I think that gcc
normally generates stabs for ELF/x86, but I haven't checked gcc 3.0.
If you compile with the -gdwarf-2 option, you will get DWARF
debugging.

If you are using stabs, bfd_find_nearest_line builds a table mapping
addresses to stabs entries.  It then does a binary search each time it
is called.  The relevant code is _bfd_stab_section_find_nearest_line
in bfd/syms.c.

Ian



More information about the Binutils mailing list