diff options
author | Kuba Mracek <mracek@apple.com> | 2017-01-06 20:57:47 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-01-06 20:57:47 +0000 |
commit | 47b4cadc8fc1d82b28f648609604c7d7bf12aa0d (patch) | |
tree | a8a30372e4f5edc748c0f44babb1bcd87781568d /lib/tsan | |
parent | 0aad13bae1d86febf022d0c9b0299183e1d00f34 (diff) |
[sanitizer] Add a 'print_module_map' flag which prints modules with UUIDs on Darwin
This patch add a new sanitizer flag, print_module_map, which enables printing a module map when the process exits, or after each report (for TSan). The output format is very similar to what Crash Reporter produces on Darwin (e.g. the format of module UUIDs). This enables users to use the existing symbol servers to offline symbolicate and aggregate reports.
Differential Revision: https://reviews.llvm.org/D27400
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r-- | lib/tsan/rtl/tsan_report.cc | 2 | ||||
-rw-r--r-- | lib/tsan/rtl/tsan_rtl.cc | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_report.cc b/lib/tsan/rtl/tsan_report.cc index 156876e5c..07fd41208 100644 --- a/lib/tsan/rtl/tsan_report.cc +++ b/lib/tsan/rtl/tsan_report.cc @@ -358,6 +358,8 @@ void PrintReport(const ReportDesc *rep) { ReportErrorSummary(rep_typ_str, frame->info); } + if (common_flags()->print_module_map == 2) PrintModuleMap(); + Printf("==================\n"); } diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc index 804f3cf64..bfb835889 100644 --- a/lib/tsan/rtl/tsan_rtl.cc +++ b/lib/tsan/rtl/tsan_rtl.cc @@ -404,6 +404,8 @@ void Initialize(ThreadState *thr) { int Finalize(ThreadState *thr) { bool failed = false; + if (common_flags()->print_module_map == 1) PrintModuleMap(); + if (flags()->atexit_sleep_ms > 0 && ThreadCount(thr) > 1) SleepForMillis(flags()->atexit_sleep_ms); |