[Lldb-commits] [PATCH] [compiler-rt] ASan debugging API for report info extraction and locating addresses

Alexander Potapenko glider at google.com
Wed Jul 16 02:45:18 PDT 2014


================
Comment at: include/sanitizer/asan_interface.h:69
@@ +68,3 @@
+  // value of the function is 1. If no error occurred yet, returns 0.
+  int __asan_get_report_data(void **pc, void **bp, void **sp, void **addr,
+                             int *is_write, size_t *access_size,
----------------
Kostya Serebryany wrote:
> I don't like the interface. 
> You may eventually need to get other kinds of data, so you will have to change this function.
> Instead, I suggest to add a set of functions like __asan_get_report_foo each of which returns just one part of report if such is known. 
As an alternative you can make `__asan_get_report_data` return the ReportData struct suggested by Kostya below.
Keep in mind you'll have to keep your LLDB scripts in sync with that struct's layout which might be less convenient than having `__asan_get_report_foo` for every foo.
On the other hand `__asan_get_report_data` is more convenient to call from the user code that includes asan_interface.h

================
Comment at: test/asan/TestCases/debug_locate.cc:8
@@ +7,3 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <sanitizer/asan_interface.h>
----------------
Please fix the includes order.

http://reviews.llvm.org/D4527






More information about the lldb-commits mailing list