From 8f214555c6eacae26d1a67dff46962a2d1680698 Mon Sep 17 00:00:00 2001 From: Marella Aditya Date: Thu, 5 Sep 2024 13:20:50 -0700 Subject: [PATCH] Fix compile error on arm ubuntu --- utils/debug.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/debug.cc b/utils/debug.cc index ec47827..df42d87 100644 --- a/utils/debug.cc +++ b/utils/debug.cc @@ -88,7 +88,9 @@ static stack_t __sigstack; static void sigsegv_handler(int sig, siginfo_t *siginfo, void *context) { ucontext_t* u = (ucontext_t*)context; -#ifdef REG_RIP // Test if the Program Counter is 64 bits +#if defined(__aarch64__) + unsigned char *pc = (unsigned char*)u->uc_mcontext.pc; +#elif REG_RIP // Test if the Program Counter is 64 bits unsigned char *pc = (unsigned char *)u->uc_mcontext.gregs[REG_RIP]; #else // 32 bit machine, PC is stored in %eip register unsigned char *pc = (unsigned char *)u->uc_mcontext.gregs[REG_EIP];