This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting back trace inside the program itself


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]