summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asmrun/signals_osdep.h19
-rwxr-xr-xconfigure2
2 files changed, 19 insertions, 2 deletions
diff --git a/asmrun/signals_osdep.h b/asmrun/signals_osdep.h
index be06c0c76..642ac7793 100644
--- a/asmrun/signals_osdep.h
+++ b/asmrun/signals_osdep.h
@@ -70,9 +70,26 @@
static void name(int sig, siginfo_t * info, void * context)
#define SET_SIGACT(sigact,name) \
- sigact.sa_sigaction = (name);
+ sigact.sa_sigaction = (name); \
+ sigact.sa_flags = SA_SIGINFO
+
+ #define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
+
+/****************** I386, MacOS X */
+
+#elif defined(TARGET_i386) && defined(SYS_macosx)
+
+ #define DECLARE_SIGNAL_HANDLER(name) \
+ static void name(int sig, siginfo_t * info, void * context)
+
+ #define SET_SIGACT(sigact,name) \
+ sigact.sa_sigaction = (name); \
sigact.sa_flags = SA_SIGINFO
+ #include <sys/ucontext.h>
+
+ #define CONTEXT_STATE (((struct ucontext *)context)->uc_mcontext->ss)
+ #define CONTEXT_PC (CONTEXT_STATE.eip)
#define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr)
/****************** MIPS, all OS */
diff --git a/configure b/configure
index cfddcd5ae..eea084e9d 100755
--- a/configure
+++ b/configure
@@ -1033,7 +1033,7 @@ fi
# Determine if system stack overflows can be detected
case "$arch,$system" in
- i386,linux_elf|amd64,linux|power,rhapsody)
+ i386,linux_elf|amd64,linux|power,rhapsody|i386,macosx)
echo "System stack overflow can be detected."
echo "#define HAS_STACK_OVERFLOW_DETECTION" >> s.h;;
*)