[llvm-commits] [compiler-rt] r171217 - in /compiler-rt/trunk: include/sanitizer/asan_interface.h lib/asan/asan_report.cc lib/asan/asan_rtl.cc

Kostya Serebryany kcc at google.com
Sat Dec 29 02:18:31 PST 2012


Author: kcc
Date: Sat Dec 29 04:18:31 2012
New Revision: 171217

URL: http://llvm.org/viewvc/llvm-project?rev=171217&view=rev
Log:
[asan] add a new interface function __asan_describe_address, useful for running asan-ified binary under a debugger (e.g. gdb)

Modified:
    compiler-rt/trunk/include/sanitizer/asan_interface.h
    compiler-rt/trunk/lib/asan/asan_report.cc
    compiler-rt/trunk/lib/asan/asan_rtl.cc

Modified: compiler-rt/trunk/include/sanitizer/asan_interface.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/asan_interface.h?rev=171217&r1=171216&r2=171217&view=diff
==============================================================================
--- compiler-rt/trunk/include/sanitizer/asan_interface.h (original)
+++ compiler-rt/trunk/include/sanitizer/asan_interface.h Sat Dec 29 04:18:31 2012
@@ -122,6 +122,10 @@
   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.

Modified: compiler-rt/trunk/lib/asan/asan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=171217&r1=171216&r2=171217&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_report.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_report.cc Sat Dec 29 04:18:31 2012
@@ -669,6 +669,10 @@
   }
 }
 
+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.

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=171217&r1=171216&r2=171217&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Sat Dec 29 04:18:31 2012
@@ -254,6 +254,7 @@
     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;
   }
 }
 





More information about the llvm-commits mailing list