add a knob to turn off PrettyStackTrace globally. Patch by Zoltan
Varga! llvm-svn: 75897
This commit is contained in:
parent
693fbb8fee
commit
5d485f7893
|
@ -18,6 +18,12 @@
|
|||
|
||||
namespace llvm {
|
||||
class raw_ostream;
|
||||
|
||||
/// DisablePrettyStackTrace - Set this to true to disable this module. This
|
||||
/// might be neccessary if the host application installs its own signal
|
||||
/// handlers which conflict with the ones installed by this module.
|
||||
/// Defaults to false.
|
||||
extern bool DisablePrettyStackTrace;
|
||||
|
||||
/// PrettyStackTraceEntry - This class is used to represent a frame of the
|
||||
/// "pretty" stack trace that is dumped when a program crashes. You can define
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include "llvm/ADT/SmallString.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace llvm {
|
||||
bool DisablePrettyStackTrace = false;
|
||||
}
|
||||
|
||||
// FIXME: This should be thread local when llvm supports threads.
|
||||
static sys::ThreadLocal<const PrettyStackTraceEntry> PrettyStackTraceHead;
|
||||
|
||||
|
@ -75,7 +79,8 @@ static void CrashHandler(void *Cookie) {
|
|||
}
|
||||
|
||||
static bool RegisterCrashPrinter() {
|
||||
sys::AddSignalHandler(CrashHandler, 0);
|
||||
if (!DisablePrettyStackTrace)
|
||||
sys::AddSignalHandler(CrashHandler, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue