[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backtrace of all stack frames, without debugger



On Fri, Sep 14, 2001, guy keren wrote about "Re: backtrace of all stack frames, without debugger":
> 
> On Thu, 13 Sep 2001, Nadav Har'El wrote:
> 
> > Ok, so that's a nice and useful trick. But I want to improve it to show the
> > code addresses of all function calls on the stack frames, not just the last
> > call.
> 
> the answer is in the question. look at /usr/include/execinfo.h . the
> ufnctions are there. one problem i noticed is that on a redhat 6.2 system,

Thanks for the pointer! Looks like exactly what I need :)

I don't agree that "the answer is in the question" though - I was looking
for such a function for a couple of hours, going through all sorts of search
engines, and I couldn't find one. And all of the time such a function is
already included in glibc, defined in some obscure header file I've never
heard of :)
Too bad they don't have a manpage for it... But now that I know what to
look for, I found a description of those functions in
	http://www.gnu.org/manual/glibc-2.2.3/html_chapter/libc_33.html

When I'll have more time I'll check if this indeed works, and more importantly:
works even when the caller is a signal handler - because these functions
do not take a stack pointer to start on (if it doesn't work, I'll just have
to take the glibc code and add another parameter).
When I have a working, useful, signal handler I'll report back to the list.


-- 
Nadav Har'El                        |        Friday, Sep 14 2001, 26 Elul 5761
nyh@math.technion.ac.il             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |The two most common elements in the
http://nadav.harel.org.il           |universe are hydrogen and stupidity.

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il