diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-10-02 12:11:17 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-10-02 12:11:17 +0000 |
commit | 1ca535700966cf5019dcc6684a62a734a7b96974 (patch) | |
tree | 3eb6195853f0fc44622ce43ba1f909edcfb9390c /include | |
parent | d0a51c02157e8293ea365ad0d429ef8e73d115de (diff) | |
download | compiler-rt-1ca535700966cf5019dcc6684a62a734a7b96974.tar.gz compiler-rt-1ca535700966cf5019dcc6684a62a734a7b96974.tar.bz2 compiler-rt-1ca535700966cf5019dcc6684a62a734a7b96974.tar.xz |
[Sanitizer/ASan] Simplify the code that prints and symbolizes stack traces. Fall back to module+offset if user-provided symbolizer failed. Use weak function __asan_symbolize instead of __asan_set_symbolize_callback in ASan interface, so that we're able to symbolize reports for errors that happen before the main() is called, for example, during module initialization.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/sanitizer/asan_interface.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h index 4d344f6a..787e8116 100644 --- a/include/sanitizer/asan_interface.h +++ b/include/sanitizer/asan_interface.h @@ -135,15 +135,13 @@ extern "C" { void __asan_set_on_error_callback(void (*callback)(void)) SANITIZER_INTERFACE_ATTRIBUTE; - // User may register its own symbolization function. It should print - // the description of instruction at address "pc" to "out_buffer". - // Description should be at most "out_size" bytes long. + // User may provide its own implementation for symbolization function. + // It should print the description of instruction at address "pc" to + // "out_buffer". Description should be at most "out_size" bytes long. // User-specified function should return true if symbolization was // successful. - typedef bool (*__asan_symbolize_callback)(const void *pc, char *out_buffer, - int out_size); - void __asan_set_symbolize_callback(__asan_symbolize_callback callback) - SANITIZER_INTERFACE_ATTRIBUTE; + bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) + SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; // Returns the estimated number of bytes that will be reserved by allocator // for request of "size" bytes. If ASan allocator can't allocate that much |