summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-11-13 17:23:21 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-11-13 17:35:58 -0800
commitfa6984a3de81b74bf03325bea71416d8bf483efb (patch)
tree81b13a759427f40e69cfc887ba6aec143a3e45a2 /lldb/tools/driver
parent1dfede3122eec83b885d788553e3620806d54650 (diff)
downloadbcm5719-llvm-fa6984a3de81b74bf03325bea71416d8bf483efb.tar.gz
bcm5719-llvm-fa6984a3de81b74bf03325bea71416d8bf483efb.zip
[LLDB] Don't install the pretty stack trace handler twice.
I noticed that currently we are printing LLVM's pretty stack trace twice. The reason is that we're calling PrintStackTraceOnErrorSignal in addition to InitLLVM, which besides some other useful things, also register LLVM's pretty stack trace handler. Differential revision: https://reviews.llvm.org/D70216
Diffstat (limited to 'lldb/tools/driver')
-rw-r--r--lldb/tools/driver/Driver.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 8140e2a04c6..2070e55d7d2 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -22,7 +22,6 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/WithColor.h"
@@ -809,13 +808,10 @@ llvm::Optional<int> InitializeReproducer(opt::InputArgList &input_args) {
int main(int argc, char const *argv[])
{
+ // Setup LLVM signal handlers and make sure we call llvm_shutdown() on
+ // destruction.
llvm::InitLLVM IL(argc, argv);
- // Print stack trace on crash.
- llvm::StringRef ToolName = llvm::sys::path::filename(argv[0]);
- llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
- llvm::PrettyStackTraceProgram X(argc, argv);
-
// Parse arguments.
LLDBOptTable T;
unsigned MAI;
@@ -824,7 +820,7 @@ int main(int argc, char const *argv[])
opt::InputArgList input_args = T.ParseArgs(arg_arr, MAI, MAC);
if (input_args.hasArg(OPT_help)) {
- printHelp(T, ToolName);
+ printHelp(T, llvm::sys::path::filename(argv[0]));
return 0;
}
OpenPOWER on IntegriCloud