Mail Archives: djgpp/1996/05/31/19:04:57
On Thu, 30 May 1996, Roland Exler wrote:
> Taking a recently posted message from A.Appleyard I've hacked a
> stack-trace for V2. With this functions it's possible to determine how
> deep the function-nesting is at a particular place in the program and
> print a stack-trace suitable for use with symify.
Or you can just do an
asm("int $3") ;
which generates a stack dump. This will abort the program though, so your
method would be better if you want to continue execution.
> This way you can trace down how you've reached some point in your program
> without generating a floating-point error or a NULL-pointer dereference.
Floating point errors won't generate a correct stack dump anyway,
at least with version V2, because the FPU has generated a hardware
interrupt, and the stack starts with the exception processor, which
hasn't got the original stack pointers set correctly for a stack dump.
> I think this part of code would help debugging many programs. I'll try to
> redefine assert() so it will print a stack-trace too.
That sounds very useful indeed.
Jeff Welty -- weltyj AT wdni DOT com
- Raw text -