[llvm-commits] [llvm] r75897 - in /llvm/trunk: include/llvm/Support/PrettyStackTrace.h lib/Support/PrettyStackTrace.cpp
Chris Lattner
sabre at nondot.org
Wed Jul 15 23:17:46 PDT 2009
Author: lattner
Date: Thu Jul 16 01:17:45 2009
New Revision: 75897
URL: http://llvm.org/viewvc/llvm-project?rev=75897&view=rev
Log:
add a knob to turn off PrettyStackTrace globally. Patch by Zoltan
Varga!
Modified:
llvm/trunk/include/llvm/Support/PrettyStackTrace.h
llvm/trunk/lib/Support/PrettyStackTrace.cpp
Modified: llvm/trunk/include/llvm/Support/PrettyStackTrace.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PrettyStackTrace.h?rev=75897&r1=75896&r2=75897&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PrettyStackTrace.h (original)
+++ llvm/trunk/include/llvm/Support/PrettyStackTrace.h Thu Jul 16 01:17:45 2009
@@ -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
Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=75897&r1=75896&r2=75897&view=diff
==============================================================================
--- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original)
+++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Thu Jul 16 01:17:45 2009
@@ -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 bool RegisterCrashPrinter() {
- sys::AddSignalHandler(CrashHandler, 0);
+ if (!DisablePrettyStackTrace)
+ sys::AddSignalHandler(CrashHandler, 0);
return false;
}
More information about the llvm-commits
mailing list