diff options
Diffstat (limited to 'compiler-rt/lib/asan/asan_linux.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_linux.cc | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/compiler-rt/lib/asan/asan_linux.cc b/compiler-rt/lib/asan/asan_linux.cc index 1f46f268c2b..740bf5e7cc6 100644 --- a/compiler-rt/lib/asan/asan_linux.cc +++ b/compiler-rt/lib/asan/asan_linux.cc @@ -68,6 +68,13 @@ void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {    *pc = ucontext->uc_mcontext.gregs[REG_EIP];    *bp = ucontext->uc_mcontext.gregs[REG_EBP];    *sp = ucontext->uc_mcontext.gregs[REG_ESP]; +# elif defined(__powerpc__) || defined(__powerpc64__) +  ucontext_t *ucontext = (ucontext_t*)context; +  *pc = ucontext->uc_mcontext.regs->nip; +  *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; +  // The powerpc{,64}-linux ABIs do not specify r31 as the frame +  // pointer, but GCC always uses r31 when we need a frame pointer. +  *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];  # elif defined(__sparc__)    ucontext_t *ucontext = (ucontext_t*)context;    uptr *stk_ptr; @@ -151,7 +158,7 @@ void GetStackTrace(StackTrace *stack, uptr max_s, uptr pc, uptr bp) {    stack->trace[0] = pc;    if ((max_s) > 1) {      stack->max_size = max_s; -#ifdef __arm__ +#if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__)      _Unwind_Backtrace(Unwind_Trace, stack);  #else      if (!asan_inited) return; | 

