1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-28 18:07:37 +01:00

Fix test build on FreeBSD.

This commit is contained in:
Konstantin Belousov 2012-05-24 12:31:26 +03:00
parent d93d96ad83
commit 61a173763e

View file

@ -214,6 +214,14 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
#elif defined(TARGET_ARM) #elif defined(TARGET_ARM)
ip = uc->uc_mcontext.arm_ip; ip = uc->uc_mcontext.arm_ip;
#endif #endif
#elif defined(__FreeBSD__)
#ifdef __i386__
ip = uc->uc_mcontext.mc_eip;
#elif defined(__amd64__)
ip = uc->uc_mcontext.mc_rip;
#else
#error Port me
#endif
#else #else
#error Port me #error Port me
#endif #endif
@ -230,7 +238,9 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
void *array[50]; void *array[50];
int size; int size;
size = backtrace(array, 50); size = backtrace(array, 50);
#ifdef __linux__
backtrace_symbols_fd(array, size, 2); backtrace_symbols_fd(array, size, 2);
#endif
} }
_exit(1); _exit(1);