[PATCH] [compiler-rt] Add ASan debugging API to get malloc/free stack traces and shadow memory mapping info

Kostya Serebryany kcc at google.com
Fri Jul 11 01:02:14 PDT 2014


================
Comment at: include/sanitizer/asan_interface.h:69
@@ +68,3 @@
+  // where the real number of frames will be returned as well.
+  int __asan_get_alloc_stack(void *addr, void **trace, size_t *frame_count,
+                             void **top_frame_bp, int *thread_id);
----------------
Does your interface need top_frame_bp? 

Also, maybe change it like this? 

// Store up to 'size' frames into 'trace', return the number of stored frames or 0 on error. 
/...
uptr __asan_get_alloc_stack(void *addr, void **trace, size_t size, int *thread)

================
Comment at: lib/asan/asan_debugging.cc:24
@@ +23,3 @@
+
+int __asan_get_stack(uptr addr, uptr *trace, uptr *frame_count,
+                     uptr *top_frame_bp, u32 *thread_id, int alloc_stack) {
----------------
This is not part of the interface, right? 
So, it should be inside the __asan namespace, should be called AsanGetStack, and alloc_stack should be boolean

http://reviews.llvm.org/D4466






More information about the llvm-commits mailing list