From fcb8c7e4072cc754ed473d0d30e8167c00daaaa2 Mon Sep 17 00:00:00 2001 From: Ismail Pazarbasi Date: Wed, 11 Nov 2015 02:38:38 +0000 Subject: [PATCH] [tsan] Pass correct interposed function prefix to report function Summary: On Darwin, interposed functions are prefixed with "wrap_". On Linux, they are prefixed with "__interceptor_". Reviewers: dvyukov, samsonov, glider, kcc, kubabrecka Subscribers: zaks.anna, llvm-commits Differential Revision: http://reviews.llvm.org/D14512 llvm-svn: 252695 --- compiler-rt/lib/tsan/rtl/tsan_report.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cc b/compiler-rt/lib/tsan/rtl/tsan_report.cc index f4b06878a58e..ad8fc9a20839 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cc +++ b/compiler-rt/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 @@ void PrintStack(const ReportStack *ent) { 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");