llvm.org GIT mirror llvm / 90bb3f3
add a knob to turn off PrettyStackTrace globally. Patch by Zoltan Varga! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75897 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
2 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1717
1818 namespace llvm {
1919 class raw_ostream;
20
21 /// DisablePrettyStackTrace - Set this to true to disable this module. This
22 /// might be neccessary if the host application installs its own signal
23 /// handlers which conflict with the ones installed by this module.
24 /// Defaults to false.
25 extern bool DisablePrettyStackTrace;
2026
2127 /// PrettyStackTraceEntry - This class is used to represent a frame of the
2228 /// "pretty" stack trace that is dumped when a program crashes. You can define
1717 #include "llvm/System/ThreadLocal.h"
1818 #include "llvm/ADT/SmallString.h"
1919 using namespace llvm;
20
21 namespace llvm {
22 bool DisablePrettyStackTrace = false;
23 }
2024
2125 // FIXME: This should be thread local when llvm supports threads.
2226 static sys::ThreadLocal PrettyStackTraceHead;
7478 }
7579
7680 static bool RegisterCrashPrinter() {
77 sys::AddSignalHandler(CrashHandler, 0);
81 if (!DisablePrettyStackTrace)
82 sys::AddSignalHandler(CrashHandler, 0);
7883 return false;
7984 }
8085