Add a new watchdog timer interface. The interface does not permit handling timeouts, so
[oota-llvm.git] / lib / Support / PrettyStackTrace.cpp
index 21d56adb5e082d65d6730154d08a73ca76bacc7e..23ee5ab105aec8316f598e42b261f2a4d4297bd2 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/Config/config.h"     // Get autoconf configuration settings
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/ThreadLocal.h"
+#include "llvm/Support/Watchdog.h"
 #include "llvm/Support/raw_ostream.h"
 
 #ifdef HAVE_CRASHREPORTERCLIENT_H
@@ -37,7 +38,10 @@ static unsigned PrintStack(const PrettyStackTraceEntry *Entry, raw_ostream &OS){
   if (Entry->getNextEntry())
     NextID = PrintStack(Entry->getNextEntry(), OS);
   OS << NextID << ".\t";
-  Entry->print(OS);
+  {
+    sys::Watchdog W(5);
+    Entry->print(OS);
+  }
   
   return NextID+1;
 }