diff options
author | Kostya Serebryany <kcc@google.com> | 2013-12-05 10:28:59 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@gcc.gnu.org> | 2013-12-05 10:28:59 +0000 |
commit | c4c16f745651177876f689b848586aa5a9f6a812 (patch) | |
tree | 9a355019c43c1ee17910aa964aac70eae64817a4 /libsanitizer/asan | |
parent | 022351a2355150868e7fd4d34b45f141e97594ee (diff) | |
download | gcc-c4c16f745651177876f689b848586aa5a9f6a812.tar.gz |
libsanitizer merge from upstream r196489
From-SVN: r205700
Diffstat (limited to 'libsanitizer/asan')
-rw-r--r-- | libsanitizer/asan/asan_mapping.h | 4 | ||||
-rw-r--r-- | libsanitizer/asan/asan_stack.cc | 8 | ||||
-rw-r--r-- | libsanitizer/asan/asan_stack.h | 9 |
3 files changed, 14 insertions, 7 deletions
diff --git a/libsanitizer/asan/asan_mapping.h b/libsanitizer/asan/asan_mapping.h index fd5c2039bca..1e37bc26e94 100644 --- a/libsanitizer/asan/asan_mapping.h +++ b/libsanitizer/asan/asan_mapping.h @@ -63,8 +63,8 @@ static const u64 kPPC64_ShadowOffset64 = 1ULL << 41; static const u64 kMIPS32_ShadowOffset32 = 0x0aaa8000; #if ASAN_FLEXIBLE_MAPPING_AND_OFFSET == 1 -extern SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_scale; -extern SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_offset; +extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_scale; +extern "C" SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_offset; # define SHADOW_SCALE (__asan_mapping_scale) # define SHADOW_OFFSET (__asan_mapping_offset) #else diff --git a/libsanitizer/asan/asan_stack.cc b/libsanitizer/asan/asan_stack.cc index 93671a03a92..24cccbd196e 100644 --- a/libsanitizer/asan/asan_stack.cc +++ b/libsanitizer/asan/asan_stack.cc @@ -43,3 +43,11 @@ bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) { return false; } #endif + +extern "C" { +SANITIZER_INTERFACE_ATTRIBUTE +void __sanitizer_print_stack_trace() { + using namespace __asan; + PRINT_CURRENT_STACK(); +} +} // extern "C" diff --git a/libsanitizer/asan/asan_stack.h b/libsanitizer/asan/asan_stack.h index c929c887d06..df7a9805f92 100644 --- a/libsanitizer/asan/asan_stack.h +++ b/libsanitizer/asan/asan_stack.h @@ -75,11 +75,10 @@ void PrintStack(const uptr *trace, uptr size); #define GET_STACK_TRACE_FREE GET_STACK_TRACE_MALLOC -#define PRINT_CURRENT_STACK() \ - { \ - GET_STACK_TRACE(kStackTraceMax, \ - common_flags()->fast_unwind_on_fatal); \ - PrintStack(&stack); \ +#define PRINT_CURRENT_STACK() \ + { \ + GET_STACK_TRACE_FATAL_HERE; \ + PrintStack(&stack); \ } #endif // ASAN_STACK_H |