[PATCH] D11365: [asan] Add a "dump_registers" flag to print out CPU registers after a SIGSEGV

Kostya Serebryany kcc at google.com
Mon Jul 20 13:16:55 PDT 2015


kcc added a comment.

Looks good in general, still a few comments


================
Comment at: lib/asan/asan_flags.inc:146
@@ -145,1 +145,3 @@
+ASAN_FLAG(bool, dump_registers, false,
+          "If true, dump values of CPU registers when SEGV happens.")
 ASAN_FLAG(const char *, suppressions, "", "Suppressions file name.")
----------------
Add something like "OSX-only for now"

================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1102
@@ +1101,3 @@
+void SignalContext::DumpAllRegisters() const {
+  // FIXME: Implement this.
+}
----------------
Add something like "Printf("DumpAllRegisters is not implemented on this platform");

same below. 

================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:438
@@ -398,1 +437,3 @@
+}
+
 }  // namespace __sanitizer
----------------
#undef the macros at the end of the function

================
Comment at: test/asan/TestCases/Darwin/dump_registers.cc:1
@@ +1,2 @@
+// Check that ASan dumps the CPU registers when dump_registers=1
+
----------------
I wonder if you can move this test one level up (not Darwin-specific) and restrict it for Darwin. 


http://reviews.llvm.org/D11365







More information about the llvm-commits mailing list