This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Problems with _Unwind_Backtrace() vs signal handlers


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


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