diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-10-25 23:03:29 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-10-25 23:03:29 +0000 |
commit | c1a1ed62228288155459d39194995a36aca4a8a6 (patch) | |
tree | 4bb3144d74f7d3db0bcfcecc867ed7b13e83e3f0 /lib/msan/msan_report.cc | |
parent | 8f0c5bdd9650256501bad9fc5dedc977f4ca2247 (diff) | |
download | compiler-rt-c1a1ed62228288155459d39194995a36aca4a8a6.tar.gz compiler-rt-c1a1ed62228288155459d39194995a36aca4a8a6.tar.bz2 compiler-rt-c1a1ed62228288155459d39194995a36aca4a8a6.tar.xz |
Overhaul the symbolizer interface.
This moves away from creating the symbolizer object and initializing the
external symbolizer as separate steps. Those steps now always take place
together.
Sanitizers with a legacy requirement to specify their own symbolizer path
should use InitSymbolizer to initialize the symbolizer with the desired
path, and GetSymbolizer to access the symbolizer. Sanitizers with no
such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for
initialization.
The symbolizer interface has been made thread-safe (as far as I can
tell) by protecting its member functions with mutexes.
Finally, the symbolizer interface no longer relies on weak externals, the
introduction of which was probably a mistake on my part.
Differential Revision: http://llvm-reviews.chandlerc.com/D1985
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_report.cc')
-rw-r--r-- | lib/msan/msan_report.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/msan/msan_report.cc b/lib/msan/msan_report.cc index 575cfc22..354bc80b 100644 --- a/lib/msan/msan_report.cc +++ b/lib/msan/msan_report.cc @@ -54,7 +54,7 @@ static void DescribeOrigin(u32 origin) { Printf(" %sUninitialized value was created by an allocation of '%s%s%s'" " in the stack frame of function '%s%s%s'%s\n", d.Origin(), d.Name(), s, d.Origin(), d.Name(), - getSymbolizer()->Demangle(sep + 1), d.Origin(), d.End()); + Symbolizer::Get()->Demangle(sep + 1), d.Origin(), d.End()); InternalFree(s); if (pc) { @@ -73,12 +73,12 @@ static void DescribeOrigin(u32 origin) { } static void ReportSummary(const char *error_type, StackTrace *stack) { - if (!stack->size || !getSymbolizer()->IsAvailable()) return; + if (!stack->size || !Symbolizer::Get()->IsAvailable()) return; AddressInfo ai; uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]); { SymbolizerScope sym_scope; - getSymbolizer()->SymbolizeCode(pc, &ai, 1); + Symbolizer::Get()->SymbolizeCode(pc, &ai, 1); } ReportErrorSummary(error_type, ai.file, ai.line, ai.function); } |