[PATCH] [Sanitizer] Implement Symbolizer class on Windows

Alexey Samsonov samsonov at google.com
Wed Dec 18 06:17:23 PST 2013



================
Comment at: lib/lsan/lsan_common.cc:483
@@ -482,3 +482,3 @@
   for (uptr i = 0; i < kMaxAddrFrames; i++) new (&addr_frames[i]) AddressInfo();
-  uptr addr_frames_num = Symbolizer::Get()->SymbolizeCode(
+  uptr addr_frames_num = Symbolizer::Get()->SymbolizePC(
       addr, addr_frames.data(), kMaxAddrFrames);
----------------
Please commit this renaming as a separate change.

================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.cc:87
@@ +86,3 @@
+        } else {
+          if (info.function && info.function_offset != AddressInfo::kUnknown)
+            frame_desc.append("+0x%zx", info.function_offset);
----------------
I suggest to put this part under "if (info.function)" above
  if (info.function) {
    frame_desc.append(...);
    // Print offset in function if we don't know the source file
    if (!info.file && info.function_offset != AddressInfo::kUnknown)
      frame_desc.append(...);
  }

In this way code corresponds to output format:
[<function>[+<offset>]] [file-line-info | module+offset]

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer.h:47
@@ -40,3 +46,3 @@
 
   // Deletes all strings and sets all fields to zero.
   void Clear() {
----------------
update the comment (or delete it)

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_win.cc:88
@@ +87,3 @@
+  static bool called_once = false;
+  CHECK(!called_once && "Shouldn't create more than onesymbolizer");
+  called_once = true;
----------------
s/onesymbolizer/one symbolizer/

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_win.cc:83
@@ +82,3 @@
+  BlockingMutex dbghelp_mu_;
+  bool initialized_;
+};
----------------
initialized_ should be initialized in the constructor.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_win.cc:67
@@ +66,3 @@
+    IMAGEHLP_MODULE64 mod_info;
+    memset(&mod_info, 0, sizeof(mod_info));
+    mod_info.SizeOfStruct = sizeof(mod_info);
----------------
internal_memset please


http://llvm-reviews.chandlerc.com/D2434



More information about the llvm-commits mailing list