Mail Archives: djgpp/2002/02/24/12:26:15
> From: gautier_niouzes AT hotmail DOT com (Gautier)
> Newsgroups: comp.os.msdos.djgpp
> Date: 24 Feb 2002 07:12:02 -0800
>
> > addr2line is a program, not a library. (It would not make sense to have
> > such a library, IMHO, since the code of addr2line is very small,
> > consisting primarily of calls to BFD functions.)
>
> There is also such a library, at least in the official GNAT distributions.
Then I'm sorry to say I don't know anything about it.
> Starting from the 3.13 version, GNAT provides optionally an
> integrated trace-back.
> When I try to make use of it the linker says
> c:/ada/gnatdos/g314dos/bin/ld.exe: cannot find -laddr2line
>
> Hence my question.
> I will rather call the addr2line program.
In my experience, addr2line is not reliable enough (I'm not even sure
it's actively maintained). It works okay with addresses from toy
programs, but if you try to feed it with the kind of traceback one
gets from a large real-life program, some of them will produce
ridiculous results, like non-existing line numbers from files compiled
without debug info, wrong offsets, etc.
So I suggest to call the bfdsymify program instead. bfdsymify is a
version of symify that calls the BFD library to produce the file and
line number info. bfdsymify is based on the code from addr2line, but
with a few significant improvements that correct the blunders in
addr2line's output. bfdsymify will be a part of the upcoming
distribution of the DJGPP port of GDB 5.1.1, which will be released
in a matter of days.
Alternatively, you could take the changes introduced into the
addr2line's algorithm that is used by bfdsymify and produce a library
function from it, which you could then call as libaddr2line.
Mail me if you want the source of bfdsymify.
- Raw text -