backtrace of the current process execution

Andrew Burgess
Fri Dec 3 18:55:00 GMT 2004

On Fri, 03 Dec 2004 16:14:27 +0100, Andreas Schwab <> wrote:

> 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.


More information about the Gdb mailing list