From 281460fba02b1d2972eb55b695c1eb66645c8c88 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Wed, 17 Jul 2002 06:51:05 +0000 Subject: [PATCH] - New arch support for IP retrieval on SIGSEGV. --- BasiliskII/src/Unix/sigsegv.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BasiliskII/src/Unix/sigsegv.cpp b/BasiliskII/src/Unix/sigsegv.cpp index 38f879fd..ac349181 100644 --- a/BasiliskII/src/Unix/sigsegv.cpp +++ b/BasiliskII/src/Unix/sigsegv.cpp @@ -233,6 +233,12 @@ static void powerpc_decode_instruction(instruction_t *instruction, unsigned int #define SIGSEGV_REGISTER_FILE (unsigned int *)SIGSEGV_CONTEXT_REGS #define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction #endif +#if (defined(x86_64) || defined(__x86_64__)) +#include +#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs) +#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[16] /* should use REG_RIP instead */ +#define SIGSEGV_REGISTER_FILE (unsigned long *)SIGSEGV_CONTEXT_REGS +#endif #if (defined(ia64) || defined(__ia64__)) #define SIGSEGV_FAULT_INSTRUCTION (((struct sigcontext *)scp)->sc_ip & ~0x3ULL) /* slot number is in bits 0 and 1 */ #endif