Suppress OS crash dialog in llvm-rtdyld
authorAlp Toker <alp@nuanti.com>
Tue, 5 Nov 2013 09:33:43 +0000 (09:33 +0000)
committerAlp Toker <alp@nuanti.com>
Tue, 5 Nov 2013 09:33:43 +0000 (09:33 +0000)
All other tools have this -- it's needed to avoid hanging lit on Windows in
case of a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194060 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-rtdyld/llvm-rtdyld.cpp

index c5c285431a4d5ec285cf26147fcc9d142bb82e2a..531595eacddd3a2c1ac921f1bf404601b04d882d 100644 (file)
@@ -22,6 +22,8 @@
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/system_error.h"
 using namespace llvm;
@@ -239,6 +241,9 @@ static int executeInput() {
 }
 
 int main(int argc, char **argv) {
+  sys::PrintStackTraceOnErrorSignal();
+  PrettyStackTraceProgram X(argc, argv);
+
   ProgramName = argv[0];
   llvm_shutdown_obj Y;  // Call llvm_shutdown() on exit.