Get sparc building again after ASAN merge.
authorDavid S. Miller <davem@davemloft.net>
Tue, 13 Nov 2012 06:53:23 +0000 (06:53 +0000)
committerDavid S. Miller <davem@gcc.gnu.org>
Tue, 13 Nov 2012 06:53:23 +0000 (22:53 -0800)
libsanitizer/

* asan/asan_linux.cc (GetPcSpBp): Add sparc support.

From-SVN: r193468

libsanitizer/ChangeLog.asan
libsanitizer/asan/asan_linux.cc

index 7fe3c0cdc64a945162f6a470f362d705cd89c696..559209211897041c91587b34ef0c5a76fd8edcbd 100644 (file)
@@ -1,3 +1,7 @@
+2012-11-12  David S. Miller  <davem@davemloft.net>
+
+       * asan/asan_linux.cc (GetPcSpBp): Add sparc support.
+
 2012-10-29  Wei Mi  <wmi@google.com>
 
        Initial checkin: migrate asan runtime from llvm.
index 2922740e7f2b7e5cf081333fbc6b769c9fdb47bd..ea7ee9e7bc86fb1ec11a9dd95f473d853016c0b8 100644 (file)
@@ -66,6 +66,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