From 10035527d166ffa2bc5c8d11bb80f2af802894af Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Mon, 10 Feb 2014 13:34:43 +0000 Subject: Add a copy of missing for Android and enable ASan SEGV handler. This change adds a copy of for Android found in google-breakpad that is missing from the official NDK. ASan SEGV handler is still disabled by default and can be enabled with ASAN_OPTIONS=handle_segv. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201084 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/asan_linux.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/asan/asan_linux.cc') diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 871068b91..042e06ed9 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -32,8 +32,9 @@ #include #include -#if !SANITIZER_ANDROID -// FIXME: where to get ucontext on Android? +#if SANITIZER_ANDROID +#include +#else #include #endif @@ -51,9 +52,7 @@ void *AsanDoesNotSupportStaticLinkage() { } void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { -#if SANITIZER_ANDROID - *pc = *sp = *bp = 0; -#elif defined(__arm__) +#if defined(__arm__) ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.arm_pc; *bp = ucontext->uc_mcontext.arm_fp; -- cgit v1.2.3