[PATCH] D14512: [tsan] Pass correct interposed function prefix to report function

Ismail Pazarbasi via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 13:11:37 PST 2015


ismailp created this revision.
ismailp added reviewers: dvyukov, samsonov, glider, kcc, kubabrecka.
ismailp added subscribers: llvm-commits, zaks.anna.

On Darwin, interposed functions are prefixed with "wrap_". On Linux,
they are prefixed with "__interceptor_".

http://reviews.llvm.org/D14512

Files:
  lib/tsan/rtl/tsan_report.cc

Index: lib/tsan/rtl/tsan_report.cc
===================================================================
--- lib/tsan/rtl/tsan_report.cc
+++ lib/tsan/rtl/tsan_report.cc
@@ -19,6 +19,12 @@
 
 namespace __tsan {
 
+#if SANITIZER_MAC
+static const char *const kInterposedFunctionPrefix = "wrap_";
+#else
+static const char *const kInterposedFunctionPrefix = "__interceptor_";
+#endif
+
 ReportStack::ReportStack() : frames(nullptr), suppressable(false) {}
 
 ReportStack *ReportStack::New() {
@@ -121,7 +127,7 @@
     InternalScopedString res(2 * GetPageSizeCached());
     RenderFrame(&res, common_flags()->stack_trace_format, i, frame->info,
                 common_flags()->symbolize_vs_style,
-                common_flags()->strip_path_prefix, "__interceptor_");
+                common_flags()->strip_path_prefix, kInterposedFunctionPrefix);
     Printf("%s\n", res.data());
   }
   Printf("\n");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14512.39743.patch
Type: text/x-patch
Size: 898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151109/7aca2233/attachment.bin>


More information about the llvm-commits mailing list