Problems with _Unwind_Backtrace() vs signal handlers

Geert Bosch bosch@gnat.com
Sun Aug 1 12:45:00 GMT 2004


On Aug 1, 2004, at 01:58, Geoffrey Keating wrote:
> Sounds like a bug in MD_FALLBACK_FRAME_STATE_FOR on your platform.
> I'd suggest looking at the powerpc-darwin implementation for
> an indication of how to get this right.

For signal handlers (esp. as a result of a trapping insn) you do not
generally want the instruction after the one that faulted, as that
would be ill-defined for an indirect jump with an invalid address
for example.

However, I believe that the unwinder always subtracts one (byte/word)
from the return address in order to get the right context for the
exception in the normal call case: a new exception handling region
might start right after  the call instruction. So to compensate for
that you'd have to add one (byte/word) to the address of the faulting
instruction in MD_FALLBACK_FRAME_STATE_FOR.

   -Geert



More information about the Gcc mailing list