diff options
| author | Kostya Serebryany <kcc@google.com> | 2012-12-29 10:18:31 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2012-12-29 10:18:31 +0000 |
| commit | b3d04ede8cfb34abbd59f3d1564646944120cf87 (patch) | |
| tree | d831a645df1eedb2c7da7b18d867ff9e9720a412 | |
| parent | db7325e56e90f0931d142575d81e9d6bd36f668f (diff) | |
| download | bcm5719-llvm-b3d04ede8cfb34abbd59f3d1564646944120cf87.tar.gz bcm5719-llvm-b3d04ede8cfb34abbd59f3d1564646944120cf87.zip | |
[asan] add a new interface function __asan_describe_address, useful for running asan-ified binary under a debugger (e.g. gdb)
llvm-svn: 171217
| -rw-r--r-- | compiler-rt/include/sanitizer/asan_interface.h | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_report.cc | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/include/sanitizer/asan_interface.h b/compiler-rt/include/sanitizer/asan_interface.h index c3382ceca03..6e8ae87232a 100644 --- a/compiler-rt/include/sanitizer/asan_interface.h +++ b/compiler-rt/include/sanitizer/asan_interface.h @@ -122,6 +122,10 @@ extern "C" { 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. diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc index 37f13e02d7c..35ab9cabde6 100644 --- a/compiler-rt/lib/asan/asan_report.cc +++ b/compiler-rt/lib/asan/asan_report.cc @@ -669,6 +669,10 @@ void NOINLINE __asan_set_error_report_callback(void (*callback)(const char*)) { } } +void __asan_describe_address(uptr addr) { + DescribeAddress(addr, 1); +} + #if !SANITIZER_SUPPORTS_WEAK_HOOKS // Provide default implementation of __asan_on_error that does nothing // and may be overriden by user. diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 9ed320ab95d..9dadd6c02a3 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -254,6 +254,7 @@ static NOINLINE void force_interface_symbols() { case 32: __asan_poison_stack_memory(0, 0); break; case 33: __asan_unpoison_stack_memory(0, 0); break; case 34: __asan_region_is_poisoned(0, 0); break; + case 35: __asan_describe_address(0); break; } } |

