Getting back trace inside the program itself

Andreas Jaeger aj@suse.de
Wed Dec 26 14:18:00 GMT 2001


"Sachin O. Agrawal" <sachin_agrawal@persistent.co.in> writes:

> Hello,
>
> Is there a way for a program (optimized and with no debugging info)
> to get the back trace information?
>
> Before every function call processor pushes the return address on
> the stack. I would like to get these return address. And later
> use them for tracing the code flow using map files. 

If you're using the GNU C library, use the functions from
<execinfo.h>, there's even a backtrace function.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Binutils mailing list