[nolibc] Move symbolizer to RTSanitizerCommonLibc, and make it optional using a weak symbol.

llvm-svn: 182372
This commit is contained in:
Peter Collingbourne 2013-05-21 12:08:37 +00:00
parent fad029202f
commit c787d42f40
5 changed files with 7 additions and 6 deletions

View File

@ -13,9 +13,7 @@ set(SANITIZER_SOURCES
sanitizer_printf.cc
sanitizer_stackdepot.cc
sanitizer_stacktrace.cc
sanitizer_symbolizer.cc
sanitizer_symbolizer_itanium.cc
sanitizer_symbolizer_linux.cc
sanitizer_symbolizer_mac.cc
sanitizer_symbolizer_win.cc
sanitizer_thread_registry.cc
@ -27,6 +25,8 @@ set(SANITIZER_LIBCDEP_SOURCES
sanitizer_linux_libcdep.cc
sanitizer_posix_libcdep.cc
sanitizer_stoptheworld_linux_libcdep.cc
sanitizer_symbolizer_libcdep.cc
sanitizer_symbolizer_linux_libcdep.cc
)
# Explicitly list all sanitizer_common headers. Not all of these are

View File

@ -85,7 +85,7 @@ void StackTrace::PrintStack(const uptr *addr, uptr size,
frame_num++;
}
}
if (symbolize && addr_frames_num == 0) {
if (symbolize && addr_frames_num == 0 && SymbolizeCode) {
// Use our own (online) symbolizer, if necessary.
addr_frames_num = SymbolizeCode(pc, addr_frames.data(),
addr_frames.size());

View File

@ -66,7 +66,8 @@ struct DataInfo {
// for a given address (in all inlined functions). Returns the number
// of descriptions actually filled.
// This function should NOT be called from two threads simultaneously.
uptr SymbolizeCode(uptr address, AddressInfo *frames, uptr max_frames);
uptr SymbolizeCode(uptr address, AddressInfo *frames, uptr max_frames)
SANITIZER_WEAK_ATTRIBUTE;
bool SymbolizeData(uptr address, DataInfo *info);
bool IsSymbolizerAvailable();

View File

@ -1,4 +1,4 @@
//===-- sanitizer_symbolizer.cc -------------------------------------------===//
//===-- sanitizer_symbolizer_libcdep.cc -----------------------------------===//
//
// The LLVM Compiler Infrastructure
//

View File

@ -1,4 +1,4 @@
//===-- sanitizer_symbolizer_linux.cc -------------------------------------===//
//===-- sanitizer_symbolizer_linux_libcdep.cc -----------------------------===//
//
// The LLVM Compiler Infrastructure
//