Skip to content

Commit

Permalink
Fix compile error on arm ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
ghamarella committed Sep 5, 2024
1 parent 3b33018 commit abf9e00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 defined(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];
Expand Down

0 comments on commit abf9e00

Please sign in to comment.