This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Getting back trace inside the program itself
- From: Ian Lance Taylor <ian at airs dot com>
- To: <sachin_agrawal at persistent dot co dot in>
- Cc: <binutils at sources dot redhat dot com>, "'Devendra Badhani \(E-mail\)'" <deven at pspl dot co dot in>, "'Shridhar Bhat \(E-mail\)'" <penguin at pspl dot co dot in>, "Masaoud Taher Moonim \(E-mail\)" <masaoud at pspl dot co dot in>
- Date: 21 Dec 2001 09:10:34 -0800
- Subject: Re: Getting back trace inside the program itself
- References: <001101c18a00$512755d0$2a05a8c0@balapur>
"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