Merge pull request #76 from tezc/fix-m1-signal

get backtrace pointer for only MAC_OS_X_VERSION_10_6
This commit is contained in:
Ozan Tezcan 2021-05-15 15:07:09 +03:00 committed by GitHub
commit a48de52daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,13 +331,13 @@ static void *sc_instruction(ucontext_t *uc)
(void) uc;
void *p = NULL;
#if defined(__APPLE__)
#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)
#if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__)
p = (void *) uc->uc_mcontext->__ss.__rip;
#elif defined(__i386__)
p = (void *) uc->uc_mcontext->__ss.__eip;
#else
p = (void *) arm_thread_state64_get_pc(uc->uc_mcontext->__ss);
p = (void *) (uintptr_t) arm_thread_state64_get_pc(uc->uc_mcontext->__ss);
#endif
#elif defined(__linux__)
#if defined(__i386__) || ((defined(__x86_64__)) && defined(__ILP32__))