This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: backtrace of the current process execution


On Fri, 03 Dec 2004 16:14:27 +0100, Andreas Schwab <schwab@suse.de> wrote:

laurent.marzullo@one-d.com writes:

I would like to know if there's a way to know the call stack of a running
process into the process itself ?

Try the backtrace function from <execinfo.h>.

This is handy but gives no _static_ symbols. I start with backtrace() and then create a pipe to addr2line (part of binutils). This gives static symbols and the exact line numbers. You could also post-process with addr2line I suppose...

Now if it only printed arguments like gdb...

It really seems like a useful feature for a libgdb since gdb already
knows how to do it.

HTH


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