asan: sync with gcc r193553
authorDmitry Vyukov <dvyukov@google.com>
Fri, 16 Nov 2012 11:26:05 +0000 (11:26 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 16 Nov 2012 11:26:05 +0000 (11:26 +0000)
llvm-svn: 168151

compiler-rt/lib/asan/asan_linux.cc

index 5c52ddc..1f46f26 100644 (file)
@@ -68,6 +68,20 @@ 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(__sparc__)
+  ucontext_t *ucontext = (ucontext_t*)context;
+  uptr *stk_ptr;
+# if defined (__arch64__)
+  *pc = ucontext->uc_mcontext.mc_gregs[MC_PC];
+  *sp = ucontext->uc_mcontext.mc_gregs[MC_O6];
+  stk_ptr = (uptr *) (*sp + 2047);
+  *bp = stk_ptr[15];
+# else
+  *pc = ucontext->uc_mcontext.gregs[REG_PC];
+  *sp = ucontext->uc_mcontext.gregs[REG_O6];
+  stk_ptr = (uptr *) *sp;
+  *bp = stk_ptr[15];
+# endif
 #else
 # error "Unsupported arch"
 #endif