get backtrace pointer for only MAC_OS_X_VERSION_10_6

This commit is contained in:
tezc 2021-05-15 14:39:51 +03:00
parent 17973df076
commit 1901bc7c76

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__))