Re: Finding the callstack programmatically

From: Ashutosh (
Date: 07/16/04

Date: Fri, 16 Jul 2004 06:34:08 GMT

Thanks. That seems to work very well with STANDALONE defined. However, if I
try to compile it (with gcc -c) and link it with my program and if I call
StackTrace() from within my program, it says "No debugger found".

On debugging this, I found that 'status' after the line "rc = waitpid(pid,
&status, 0)" is 512. 'pid' was non-zero (and on doing a 'ps', it
corresponded to 'sh <defunct>'.

If I define USE_BUILTIN, it has a Segmentation fault.


"Bjorn Reese" <breese@see.signature> wrote in message
> On Thu, 15 Jul 2004 13:45:55 +0000, Ashutosh wrote:
> > Is there a way to find the call stack at any point of time inside a
> > program?
> > Whenever my program raises a SIGSEGV, is it possible for me to print the
> > function call stack in the SIGSEGV handler?
> See stacktrace.c in
> --
> mail1dotstofanetdotdk