diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-07-17 10:04:19 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-07-17 10:04:19 +0000 |
| commit | 2ad6e0a6966afc1c74720448c8a0f76a3c2a1aaa (patch) | |
| tree | 3f0b46672afbbbbabf2574215626e80ea007f73e /lldb/tools/driver/Driver.cpp | |
| parent | a35798db9155e5b794e76e860e59685dbd16476c (diff) | |
| download | bcm5719-llvm-2ad6e0a6966afc1c74720448c8a0f76a3c2a1aaa.tar.gz bcm5719-llvm-2ad6e0a6966afc1c74720448c8a0f76a3c2a1aaa.zip | |
Move pretty stack trace printer into driver.
We used to have a pretty stack trace printer in SystemInitializerCommon.
This was disabled on Apple because we didn't want the library to be
setting signal handlers, as this was causing issues when loaded into
Xcode. However, I think it's useful to have this for the LLDB driver, so
I moved it up to use the PrettyStackTraceProgram in the driver's main.
Differential revision: https://reviews.llvm.org/D49377
llvm-svn: 337261
Diffstat (limited to 'lldb/tools/driver/Driver.cpp')
| -rw-r--r-- | lldb/tools/driver/Driver.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index e28093482f3..f3391a55e0d 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -41,7 +41,10 @@ #include "lldb/API/SBStringList.h" #include "lldb/API/SBTarget.h" #include "lldb/API/SBThread.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/ConvertUTF.h" +#include "llvm/Support/PrettyStackTrace.h" +#include "llvm/Support/Signals.h" #include <thread> #if !defined(__APPLE__) @@ -1231,6 +1234,10 @@ main(int argc, char const *argv[]) const char **argv = argvPointers.data(); #endif + llvm::StringRef ToolName = argv[0]; + llvm::sys::PrintStackTraceOnErrorSignal(ToolName); + llvm::PrettyStackTraceProgram X(argc, argv); + SBDebugger::Initialize(); SBHostOS::ThreadCreated("<lldb.driver.main-thread>"); |

