From 5c40019a92a1683fd790a80f53f8ca6c24289e46 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 30 Jan 2014 10:30:36 -0800 Subject: [PATCH] Clean up UnwindCurrent.cpp's use of ucontext.h. Change-Id: I9eff7486b9fe89eac57b5555649b871bc6f1cc77 --- libbacktrace/UnwindCurrent.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/libbacktrace/UnwindCurrent.cpp b/libbacktrace/UnwindCurrent.cpp index 17b71b94d..461ed02cf 100644 --- a/libbacktrace/UnwindCurrent.cpp +++ b/libbacktrace/UnwindCurrent.cpp @@ -27,26 +27,7 @@ #include "UnwindCurrent.h" #include "UnwindMap.h" -// Define the ucontext_t structures needed for each supported arch. -#if defined(__arm__) - // The current version of the doesn't define ucontext_t. - #include // Ensure 'struct sigcontext' is defined. - - // Machine context at the time a signal was raised. - typedef struct ucontext { - uint32_t uc_flags; - struct ucontext* uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - uint32_t uc_sigmask; - } ucontext_t; -#elif defined(__i386__) - #include - #include - typedef struct ucontext ucontext_t; -#elif !defined(__mips__) && !defined(__aarch64__) - #error Unsupported architecture. -#endif +#include //------------------------------------------------------------------------- // UnwindCurrent functions. @@ -158,7 +139,7 @@ void UnwindCurrent::ExtractContext(void* sigcontext) { context->regs[13] = uc->uc_mcontext.arm_sp; context->regs[14] = uc->uc_mcontext.arm_lr; context->regs[15] = uc->uc_mcontext.arm_pc; -#elif defined(__mips__) || defined(__i386__) +#else context->uc_mcontext = uc->uc_mcontext; #endif }