<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Incidentally, this is a pattern common to most of the tools..<br>
<br>
<code>// Print a stack trace if we signal out.</code><code><br>
</code><code>sys::PrintStackTraceOnErrorSignal();</code><code><br>
</code><code>PrettyStackTraceProgram X(argc, argv);</code><code><br>
</code><code>llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.</code><code><br>
</code><code>cl::ParseCommandLineOptions(argc, argv, "llvm dwarf
dumper\n");</code><br>
<br>
Could be rolled up into a more idiomatic LLVMProgram RAII object.<br>
<br>
Alp.<br>
<br>
<br>
<div class="moz-cite-prefix">On 05/11/2013 09:33, Alp Toker wrote:<br>
</div>
<blockquote cite="mid:20131105093344.2F4C82A6C029@llvm.org"
type="cite">
<pre wrap="">Author: alp
Date: Tue Nov 5 03:33:43 2013
New Revision: 194060
URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project?rev=194060&view=rev">http://llvm.org/viewvc/llvm-project?rev=194060&view=rev</a>
Log:
Suppress OS crash dialog in llvm-rtdyld
All other tools have this -- it's needed to avoid hanging lit on Windows in
case of a crash.
Modified:
llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
URL: <a class="moz-txt-link-freetext" href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=194060&r1=194059&r2=194060&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=194060&r1=194059&r2=194060&view=diff</a>
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Tue Nov 5 03:33:43 2013
@@ -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.
_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
</body>
</html>