Commit 49522de2 by Geoffrey Keating Committed by Geoffrey Keating

darwin-fallback.c: Compile file only on powerpc.

	* config/rs6000/darwin-fallback.c: Compile file only on powerpc.
	(handle_syscall): Handle direct system calls.
	* config/rs6000/darwin.h (HAS_MD_FALLBACK_FRAME_STATE_FOR): Delete.

From-SVN: r122877
parent 442a795b
2007-03-11 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/darwin-fallback.c: Compile file only on powerpc.
(handle_syscall): Handle direct system calls.
* config/rs6000/darwin.h (HAS_MD_FALLBACK_FRAME_STATE_FOR): Delete.
2007-03-12 Brooks Moses <brooks.moses@codesourcery.com> 2007-03-12 Brooks Moses <brooks.moses@codesourcery.com>
* doc/invoke.texi: Fix cpp.info cross-reference. * doc/invoke.texi: Fix cpp.info cross-reference.
......
/* Fallback frame-state unwinder for Darwin. /* Fallback frame-state unwinder for Darwin.
Copyright (C) 2004, 2005 Free Software Foundation, Inc. Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#ifdef __ppc__
#include "tconfig.h" #include "tconfig.h"
#include "tsystem.h" #include "tsystem.h"
#include "coretypes.h" #include "coretypes.h"
...@@ -327,9 +329,9 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], ...@@ -327,9 +329,9 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32],
static _Unwind_Ptr return_addr; static _Unwind_Ptr return_addr;
/* Yay! We're in a Libc that we understand, and it's made a /* Yay! We're in a Libc that we understand, and it's made a
system call. It'll be one of two kinds: either a Jaguar-style system call. In Jaguar, this is a direct system call with value 103;
SYS_sigreturn, or a Panther-style 'syscall' call with 184, which in Panther and Tiger it is a SYS_syscall call for system call number 184,
is also SYS_sigreturn. */ and in Leopard it is a direct syscall with number 184. */
if (gprs[0] == 0x67 /* SYS_SIGRETURN */) if (gprs[0] == 0x67 /* SYS_SIGRETURN */)
{ {
...@@ -339,7 +341,7 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], ...@@ -339,7 +341,7 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32],
is_64 = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE is_64 = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE
|| uctx->mcsize == UC_FLAVOR64_SIZE); || uctx->mcsize == UC_FLAVOR64_SIZE);
} }
else if (gprs[0] == 0 && gprs[3] == 184) else if (gprs[0] == 0 /* SYS_syscall */ && gprs[3] == 184)
{ {
int ctxstyle = gprs[5]; int ctxstyle = gprs[5];
uctx = (struct gcc_ucontext *) gprs[4]; uctx = (struct gcc_ucontext *) gprs[4];
...@@ -348,6 +350,15 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], ...@@ -348,6 +350,15 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32],
is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC
|| ctxstyle == UC_FLAVOR64 || ctxstyle == UC_TRAD64); || ctxstyle == UC_FLAVOR64 || ctxstyle == UC_TRAD64);
} }
else if (gprs[0] == 184 /* SYS_sigreturn */)
{
int ctxstyle = gprs[4];
uctx = (struct gcc_ucontext *) gprs[3];
is_vector = (ctxstyle == UC_FLAVOR_VEC || ctxstyle == UC_FLAVOR64_VEC
|| ctxstyle == UC_TRAD_VEC || ctxstyle == UC_TRAD64_VEC);
is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC
|| ctxstyle == UC_FLAVOR64 || ctxstyle == UC_TRAD64);
}
else else
return false; return false;
...@@ -469,3 +480,4 @@ _Unwind_fallback_frame_state_for (struct _Unwind_Context *context, ...@@ -469,3 +480,4 @@ _Unwind_fallback_frame_state_for (struct _Unwind_Context *context,
return false; return false;
return handle_syscall (fs, gprs, _Unwind_GetCFA (context)); return handle_syscall (fs, gprs, _Unwind_GetCFA (context));
} }
#endif
...@@ -412,8 +412,6 @@ ...@@ -412,8 +412,6 @@
#define MD_UNWIND_SUPPORT "config/rs6000/darwin-unwind.h" #define MD_UNWIND_SUPPORT "config/rs6000/darwin-unwind.h"
#endif #endif
#define HAS_MD_FALLBACK_FRAME_STATE_FOR 1
/* True, iff we're generating fast turn around debugging code. When /* True, iff we're generating fast turn around debugging code. When
true, we arrange for function prologues to start with 5 nops so true, we arrange for function prologues to start with 5 nops so
that gdb may insert code to redirect them, and for data to be that gdb may insert code to redirect them, and for data to be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment