Make sure to print a stack trace whenever an error signal is delivered to the
authorChris Lattner <sabre@nondot.org>
Thu, 19 Feb 2004 20:32:12 +0000 (20:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 19 Feb 2004 20:32:12 +0000 (20:32 +0000)
tool.

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

tools/llvm-ar/llvm-ar.cpp
tools/llvm-as/llvm-as.cpp
tools/llvm-db/llvm-db.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-link/llvm-link.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-prof/llvm-prof.cpp
tools/opt/opt.cpp

index 2404288d304f499b96120ac5165cb247ce3befb2..030ffe4914fb9a25e4b50698c99a4d2398c947a2 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Bytecode/Reader.h"
 #include "Support/CommandLine.h"
 #include "Support/FileUtilities.h"
+#include "Support/Signals.h"
 #include <string>
 #include <fstream>
 #include <cstdio>
@@ -544,9 +545,9 @@ void parseCL() {
 }
 
 int main(int argc, char **argv) {
-
-  //Parse Command line options
   cl::ParseCommandLineOptions(argc, argv);
+  PrintStackTraceOnErrorSignal();
+
   parseCL();
 
   //Create archive!
index 9be5afff116134165b76f36d36627cb0776cf94c..4b66b78efb72dd7db887f896988b652449e04130 100644 (file)
@@ -45,6 +45,7 @@ DisableVerify("disable-verify", cl::Hidden,
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
+  PrintStackTraceOnErrorSignal();
 
   std::ostream *Out = 0;
   try {
index 124db2ba06a7aed92e482200739dd2ac7bb41c6b..e450520c278b1aa000c06080a9fe45ac87f698cf 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "CLIDebugger.h"
 #include "Support/CommandLine.h"
+#include "Support/Signals.h"
 #include <iostream>
 
 using namespace llvm;
@@ -51,6 +52,7 @@ namespace {
 int main(int argc, char **argv, char * const *envp) {
   cl::ParseCommandLineOptions(argc, argv,
                               " llvm source-level debugger\n");
+  PrintStackTraceOnErrorSignal();
 
   if (Version || !Quiet) {
     std::cout << "llvm-db: The LLVM source-level debugger\n";
index 6b9c1c2a9e15bac33f5fda73585e7f8fc38f7332..d9c175166bd1304c841f946516648484ab2785f3 100644 (file)
@@ -53,6 +53,8 @@ WriteMode(cl::desc("Specify the output format:"),
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
+  PrintStackTraceOnErrorSignal();
+
   std::ostream *Out = &std::cout;  // Default to printing to stdout...
   std::string ErrorMessage;
 
index 1b3dda790d32b9be90718f3e2460f0f3da271780..4fe8637482c539b5604188867ecf438cf4e76bfb 100644 (file)
@@ -84,6 +84,7 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm linker\n");
+  PrintStackTraceOnErrorSignal();
   assert(InputFilenames.size() > 0 && "OneOrMore is not working");
 
   unsigned BaseArg = 0;
index 8678536962d072f4c9602999bd9c33b0b4e51a59..c5930e93728f2ab0f32c3cd963378522eb1df59f 100644 (file)
@@ -20,6 +20,7 @@
 #include "llvm/Bytecode/Reader.h"
 #include "Support/CommandLine.h"
 #include "Support/FileUtilities.h"
+#include "Support/Signals.h"
 #include <cctype>
 #include <cstring>
 
@@ -146,6 +147,8 @@ void DumpSymbolNamesFromFile (std::string &Filename) {
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm symbol table dumper\n");
+  PrintStackTraceOnErrorSignal();
+
   ToolName = argv[0];
   if (BSDFormat) OutputFormat = bsd;
   if (POSIXFormat) OutputFormat = posix;
index 3c9c3906ff37aa886b4720d0279d59ad72f765d9..2a7789dcd5352e85c67c9a877c2504a2ba3cb3ec 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/ProfileInfoLoader.h"
 #include "llvm/Bytecode/Reader.h"
 #include "Support/CommandLine.h"
+#include "Support/Signals.h"
 #include <cstdio>
 #include <map>
 #include <set>
@@ -80,6 +81,7 @@ namespace {
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n");
+  PrintStackTraceOnErrorSignal();
 
   // Read in the bytecode file...
   std::string ErrorMessage;
index d032e24ccd005511b84e8d4627ed98f904fb4ce6..35874b2ed7e0d63bec1b6a746e468a995203f986 100644 (file)
@@ -72,6 +72,7 @@ QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv,
                              " llvm .bc -> .bc modular optimizer\n");
+  PrintStackTraceOnErrorSignal();
 
   // Allocate a full target machine description only if necessary...
   // FIXME: The choice of target should be controllable on the command line.