This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with _Unwind_Backtrace() vs signal handlers
- From: Geert Bosch <bosch at gnat dot com>
- To: Geoffrey Keating <geoffk at geoffk dot org>
- Cc: gcc at gcc dot gnu dot org, Bryce McKinlay <mckinlay at redhat dot com>
- Date: Sun, 1 Aug 2004 08:45:09 -0400
- Subject: Re: Problems with _Unwind_Backtrace() vs signal handlers
- References: <410C33B6.1030903@redhat.com> <m2brhvtn55.fsf@greed.local>
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