Getting back trace inside the program itself

Ian Lance Taylor ian@airs.com
Fri Dec 21 10:09:00 GMT 2001


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

> Is there a way for a program (optimized and with no debugging info)
> to get the back trace information?

If you are using gcc, you can try using __builtin_return_address.  See
    http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_5.html#SEC112
It's not particularly convenient since the argument must be a constant
integer.  You may well wind up having to write your own stack
backtracer.

In any case, this question is not appropriate for the binutils mailing
list.  This is not a list for questions about writing programs.  It is
a list for discussion of the GNU binutils.  Since I think you are
talking about an embedded system, you might try the crossgcc mailing
list:
    http://www.objsw.com/CrossGCC/

Ian



More information about the Binutils mailing list