www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/24/12:26:15

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Sun, 24 Feb 2002 18:20:53 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <7458-Sun24Feb2002182053+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <17cd177c.0202240712.4297961e@posting.google.com>
(gautier_niouzes AT hotmail DOT com)
Subject: Re: Where to find libaddr2line.a for DJGPP ?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020224125927 DOT 29008A-100000 AT is> <17cd177c DOT 0202240712 DOT 4297961e AT posting DOT google DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019