diff options
Diffstat (limited to 'libsanitizer/include/sanitizer/asan_interface.h')
-rw-r--r-- | libsanitizer/include/sanitizer/asan_interface.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libsanitizer/include/sanitizer/asan_interface.h b/libsanitizer/include/sanitizer/asan_interface.h index b94b303f3ac..47f780ceaa3 100644 --- a/libsanitizer/include/sanitizer/asan_interface.h +++ b/libsanitizer/include/sanitizer/asan_interface.h @@ -115,6 +115,15 @@ extern "C" { bool __asan_address_is_poisoned(void const volatile *addr) SANITIZER_INTERFACE_ATTRIBUTE; + // If at least on byte in [beg, beg+size) is poisoned, return the address + // of the first such byte. Otherwise return 0. + uptr __asan_region_is_poisoned(uptr beg, uptr size) + SANITIZER_INTERFACE_ATTRIBUTE; + + // Print the description of addr (useful when debugging in gdb). + void __asan_describe_address(uptr addr) + SANITIZER_INTERFACE_ATTRIBUTE; + // This is an internal function that is called to report an error. // However it is still a part of the interface because users may want to // set a breakpoint on this function in a debugger. @@ -138,7 +147,7 @@ extern "C" { // User may provide function that would be called right when ASan detects // an error. This can be used to notice cases when ASan detects an error, but // the program crashes before ASan report is printed. - void __asan_on_error() + /* OPTIONAL */ void __asan_on_error() SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; // User may provide its own implementation for symbolization function. @@ -146,7 +155,8 @@ extern "C" { // "out_buffer". Description should be at most "out_size" bytes long. // User-specified function should return true if symbolization was // successful. - bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) + /* OPTIONAL */ 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 @@ -186,20 +196,19 @@ extern "C" { void __asan_print_accumulated_stats() SANITIZER_INTERFACE_ATTRIBUTE; - // This function may be overriden by user to provide a string containing - // ASan runtime options. See asan_flags.h for details. - const char* __asan_default_options() + // This function may be optionally provided by user and should return + // a string containing ASan runtime options. See asan_flags.h for details. + /* OPTIONAL */ const char* __asan_default_options() SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; - // Malloc hooks that may be overriden by user. + // Malloc hooks that may be optionally provided by user. // __asan_malloc_hook(ptr, size) is called immediately after // allocation of "size" bytes, which returned "ptr". // __asan_free_hook(ptr) is called immediately before // deallocation of "ptr". - // If user doesn't provide implementations of these hooks, they are no-op. - void __asan_malloc_hook(void *ptr, uptr size) + /* OPTIONAL */ void __asan_malloc_hook(void *ptr, uptr size) SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; - void __asan_free_hook(void *ptr) + /* OPTIONAL */ void __asan_free_hook(void *ptr) SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; } // extern "C" |