diff options
Diffstat (limited to 'contrib/llvm/lib/Support/Signals.cpp')
-rw-r--r-- | contrib/llvm/lib/Support/Signals.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/llvm/lib/Support/Signals.cpp b/contrib/llvm/lib/Support/Signals.cpp index 57f36bf175b3..256a22dee87b 100644 --- a/contrib/llvm/lib/Support/Signals.cpp +++ b/contrib/llvm/lib/Support/Signals.cpp @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Support/Signals.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Config/config.h" @@ -23,18 +24,23 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Mutex.h" #include "llvm/Support/Program.h" -#include "llvm/Support/Signals.h" #include "llvm/Support/StringSaver.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Options.h" #include <vector> -namespace llvm { - //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only TRULY operating system //=== independent code. //===----------------------------------------------------------------------===// +using namespace llvm; + +static cl::opt<bool> + DisableSymbolication("disable-symbolication", + cl::desc("Disable symbolizing crash backtraces."), + cl::init(false), cl::Hidden); + static ManagedStatic<std::vector<std::pair<void (*)(void *), void *>>> CallBacksToRun; void sys::RunSignalHandlers() { @@ -44,9 +50,6 @@ void sys::RunSignalHandlers() { I.first(I.second); CallBacksToRun->clear(); } -} - -using namespace llvm; static bool findModulesAndOffsets(void **StackTrace, int Depth, const char **Modules, intptr_t *Offsets, @@ -70,6 +73,9 @@ static bool printSymbolizedStackTrace(StringRef Argv0, static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, int Depth, llvm::raw_ostream &OS) { + if (DisableSymbolication) + return false; + // Don't recursively invoke the llvm-symbolizer binary. if (Argv0.find("llvm-symbolizer") != std::string::npos) return false; |