summaryrefslogtreecommitdiffstats
path: root/asmrun/signals_osdep.h
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2004-08-13 13:38:27 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2004-08-13 13:38:27 +0000
commit6310a642de9a696dbef29e940082abdfc20e1b05 (patch)
tree6a3f767e2b25e98337705ecf5b85f56215509132 /asmrun/signals_osdep.h
parent9dff4b1fa24c727bb4be971fcc39f5cf0148a32a (diff)
Detection stack overflow pour AMD64/Linux
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6602 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmrun/signals_osdep.h')
-rw-r--r--asmrun/signals_osdep.h12
1 files changed, 6 insertions, 6 deletions
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 */