summaryrefslogtreecommitdiffstats
path: root/asmrun
diff options
context:
space:
mode:
Diffstat (limited to 'asmrun')
-rw-r--r--asmrun/signals.c3
-rw-r--r--asmrun/signals_osdep.h12
2 files changed, 9 insertions, 6 deletions
diff --git a/asmrun/signals.c b/asmrun/signals.c
index dcab290b5..6f3c607ae 100644
--- a/asmrun/signals.c
+++ b/asmrun/signals.c
@@ -13,6 +13,9 @@
/* $Id$ */
+#if defined(TARGET_amd64) && defined (SYS_linux)
+#define _GNU_SOURCE
+#endif
#include <signal.h>
#include <stdio.h>
#include "alloc.h"
diff --git a/asmrun/signals_osdep.h b/asmrun/signals_osdep.h
index 2491aad79..a2b0652e9 100644
--- a/asmrun/signals_osdep.h
+++ b/asmrun/signals_osdep.h
@@ -34,7 +34,7 @@
/****************** AMD64, Linux */
-#elif defined(TARGET_amd64) && defined (SYS_linux_elf)
+#elif defined(TARGET_amd64) && defined (SYS_linux)
#define DECLARE_SIGNAL_HANDLER(name) \
static void name(int sig, siginfo_t * info, ucontext_t * context)
@@ -43,11 +43,11 @@
sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \
sigact.sa_flags = SA_SIGINFO
- typedef unsigned long context_reg;
- #define CONTEXT_PC (context->uc_mcontext.rip)
- #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.r14)
- #define CONTEXT_YOUNG_PTR (context->uc_mcontext.r15)
- #define CONTEXT_FAULTING_ADDRESS ((char *) context->uc_mcontext.cr2)
+ typedef greg_t context_reg;
+ #define CONTEXT_PC (context->uc_mcontext.gregs[REG_RIP])
+ #define CONTEXT_EXCEPTION_POINTER (context->uc_mcontext.gregs[REG_R14])
+ #define CONTEXT_YOUNG_PTR (context->uc_mcontext.gregs[REG_R15])
+ #define CONTEXT_FAULTING_ADDRESS ((char *) context->uc_mcontext.gregs[REG_CR2])
/****************** I386, Linux */