diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-10-29 05:31:25 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-10-29 05:31:25 +0000 |
commit | a687d2593f44f532d27cbf65002452c2396dce5c (patch) | |
tree | bd376c0a0459da591557be151dcb43455a5b172c /compiler-rt | |
parent | 51bfb820ccfa2142ada23f16a3af460695a50250 (diff) | |
download | bcm5719-llvm-a687d2593f44f532d27cbf65002452c2396dce5c.tar.gz bcm5719-llvm-a687d2593f44f532d27cbf65002452c2396dce5c.zip |
[Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags to turn on/off the symbolization
llvm-svn: 193587
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/asan/asan_stack.cc | 5 | ||||
-rw-r--r-- | compiler-rt/lib/lsan/lsan_common.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/msan/msan.cc | 1 | ||||
-rw-r--r-- | compiler-rt/lib/msan/msan_report.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc | 4 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/compiler-rt/lib/asan/asan_stack.cc b/compiler-rt/lib/asan/asan_stack.cc index b70ee81410e..7fa9e05aae7 100644 --- a/compiler-rt/lib/asan/asan_stack.cc +++ b/compiler-rt/lib/asan/asan_stack.cc @@ -29,9 +29,8 @@ void PrintStack(const uptr *trace, uptr size) { Printf("<empty stack>\n\n"); return; } - StackTrace::PrintStack(trace, size, common_flags()->symbolize, - MaybeCallAsanSymbolize); - Printf("\n"); + StackTrace::PrintStack(trace, size, MaybeCallAsanSymbolize); + Printf("\n"); } void PrintStack(StackTrace *stack) { diff --git a/compiler-rt/lib/lsan/lsan_common.cc b/compiler-rt/lib/lsan/lsan_common.cc index 8a3bc2e36e3..e305c0e2318 100644 --- a/compiler-rt/lib/lsan/lsan_common.cc +++ b/compiler-rt/lib/lsan/lsan_common.cc @@ -295,7 +295,7 @@ static void PrintStackTraceById(u32 stack_trace_id) { CHECK(stack_trace_id); uptr size = 0; const uptr *trace = StackDepotGet(stack_trace_id, &size); - StackTrace::PrintStack(trace, size, common_flags()->symbolize, 0); + StackTrace::PrintStack(trace, size); } // ForEachChunk callback. Aggregates unreachable chunks into a LeakReport. diff --git a/compiler-rt/lib/msan/msan.cc b/compiler-rt/lib/msan/msan.cc index 9238431543a..8d2c5ec9c9a 100644 --- a/compiler-rt/lib/msan/msan.cc +++ b/compiler-rt/lib/msan/msan.cc @@ -142,6 +142,7 @@ static void ParseFlagsFromString(Flags *f, const char *str) { static void InitializeFlags(Flags *f, const char *options) { CommonFlags *cf = common_flags(); cf->external_symbolizer_path = GetEnv("MSAN_SYMBOLIZER_PATH"); + cf->symbolize = true; cf->strip_path_prefix = ""; cf->fast_unwind_on_fatal = false; cf->fast_unwind_on_malloc = true; diff --git a/compiler-rt/lib/msan/msan_report.cc b/compiler-rt/lib/msan/msan_report.cc index c0765016074..a629304e601 100644 --- a/compiler-rt/lib/msan/msan_report.cc +++ b/compiler-rt/lib/msan/msan_report.cc @@ -36,7 +36,7 @@ class Decorator: private __sanitizer::AnsiColorDecorator { static void PrintStack(const uptr *trace, uptr size) { SymbolizerScope sym_scope; - StackTrace::PrintStack(trace, size, true, 0); + StackTrace::PrintStack(trace, size); Printf("\n"); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc index 2e9640b8802..70209f2512d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc @@ -38,7 +38,7 @@ static void PrintStackFramePrefix(uptr frame_num, uptr pc) { Printf(" #%zu 0x%zx", frame_num, pc); } -void StackTrace::PrintStack(const uptr *addr, uptr size, bool symbolize, +void StackTrace::PrintStack(const uptr *addr, uptr size, SymbolizeCallback symbolize_callback) { MemoryMappingLayout proc_maps(/*cache_enabled*/true); InternalScopedBuffer<char> buff(GetPageSizeCached() * 2); @@ -62,7 +62,7 @@ void StackTrace::PrintStack(const uptr *addr, uptr size, bool symbolize, frame_num++; } } - if (symbolize && addr_frames_num == 0) { + if (common_flags()->symbolize && addr_frames_num == 0) { // Use our own (online) symbolizer, if necessary. if (Symbolizer *sym = Symbolizer::GetOrNull()) addr_frames_num = diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h index c191d891832..e66e2a9b95d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h @@ -34,8 +34,8 @@ struct StackTrace { uptr size; uptr trace[kStackTraceMax]; - static void PrintStack(const uptr *addr, uptr size, bool symbolize, - SymbolizeCallback symbolize_callback); + static void PrintStack(const uptr *addr, uptr size, + SymbolizeCallback symbolize_callback = 0); void CopyFrom(const uptr *src, uptr src_size) { size = src_size; |