diff options
author | Kostya Serebryany <kcc@google.com> | 2016-02-04 02:02:09 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-02-04 02:02:09 +0000 |
commit | 2aa0339aea9c1adc1039ae0922e55168cf211ad0 (patch) | |
tree | 33f827fc452e3639580a071cc678b7a7a67604ea /lib/sanitizer_common/sanitizer_linux.cc | |
parent | a29fa41fc3ca1602870b790560b468c916316489 (diff) |
[asan] When catching a signal caused by a memory access, print if it's a READ or a WRITE. This touches win/mac files which I have not tested, if a win/mac bot fails I'll try to quick-fix
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_linux.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_linux.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc index 89fa80e29..80009ea4e 100644 --- a/lib/sanitizer_common/sanitizer_linux.cc +++ b/lib/sanitizer_common/sanitizer_linux.cc @@ -1155,6 +1155,11 @@ void *internal_start_thread(void (*func)(void *), void *arg) { return 0; } void internal_join_thread(void *th) {} #endif +bool GetSigContextWriteFlag(void *context) { + ucontext_t *ucontext = (ucontext_t*)context; + return ucontext->uc_mcontext.gregs[REG_ERR] & 2; +} + void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { #if defined(__arm__) ucontext_t *ucontext = (ucontext_t*)context; |