diff options
author | David S. Miller <davem@davemloft.net> | 2012-11-13 06:53:23 +0000 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 2012-11-12 22:53:23 -0800 |
commit | d2860e723678add863c703bee2ab3f7d7f5185fd (patch) | |
tree | 4e47f3d4541a080dbb1b6eab719496f1a429b5cf | |
parent | 097f98d44dd72329f57ede51399a7d99f3a93bcd (diff) | |
download | gcc-d2860e723678add863c703bee2ab3f7d7f5185fd.zip gcc-d2860e723678add863c703bee2ab3f7d7f5185fd.tar.gz gcc-d2860e723678add863c703bee2ab3f7d7f5185fd.tar.bz2 |
Get sparc building again after ASAN merge.
libsanitizer/
* asan/asan_linux.cc (GetPcSpBp): Add sparc support.
From-SVN: r193468
-rw-r--r-- | libsanitizer/ChangeLog.asan | 4 | ||||
-rw-r--r-- | libsanitizer/asan/asan_linux.cc | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libsanitizer/ChangeLog.asan b/libsanitizer/ChangeLog.asan index 7fe3c0c..5592092 100644 --- a/libsanitizer/ChangeLog.asan +++ b/libsanitizer/ChangeLog.asan @@ -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. diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc index 2922740..ea7ee9e 100644 --- a/libsanitizer/asan/asan_linux.cc +++ b/libsanitizer/asan/asan_linux.cc @@ -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 |