Index: source/Initialization/SystemInitializerCommon.cpp =================================================================== --- source/Initialization/SystemInitializerCommon.cpp +++ source/Initialization/SystemInitializerCommon.cpp @@ -29,7 +29,6 @@ #include "lldb/Host/windows/windows.h" #endif -#include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/TargetSelect.h" #include @@ -63,9 +62,6 @@ } #endif -#if not defined(__APPLE__) - llvm::EnablePrettyStackTrace(); -#endif Log::Initialize(); HostInfo::Initialize(); static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); Index: tools/driver/Driver.cpp =================================================================== --- tools/driver/Driver.cpp +++ 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 #if !defined(__APPLE__) @@ -1225,6 +1228,10 @@ const char **argv = argvPointers.data(); #endif + llvm::StringRef ToolName = argv[0]; + llvm::sys::PrintStackTraceOnErrorSignal(ToolName); + llvm::PrettyStackTraceProgram X(argc, argv); + SBDebugger::Initialize(); SBHostOS::ThreadCreated(""); Index: tools/lldb-mi/MIDriverMain.cpp =================================================================== --- tools/lldb-mi/MIDriverMain.cpp +++ tools/lldb-mi/MIDriverMain.cpp @@ -33,6 +33,9 @@ // Third party headers: #include "lldb/API/SBHostOS.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/PrettyStackTrace.h" +#include "llvm/Support/Signals.h" #include #include #include @@ -174,6 +177,10 @@ #endif // _WIN32 #endif // MICONFIG_DEBUG_SHOW_ATTACH_DBG_DLG + llvm::StringRef ToolName = argv[0]; + llvm::sys::PrintStackTraceOnErrorSignal(ToolName); + llvm::PrettyStackTraceProgram X(argc, argv); + // *** Order is important here *** bool bOk = DriverSystemInit(); if (!bOk) { Index: tools/lldb-server/lldb-server.cpp =================================================================== --- tools/lldb-server/lldb-server.cpp +++ tools/lldb-server/lldb-server.cpp @@ -12,7 +12,10 @@ #include "lldb/lldb-private.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/PrettyStackTrace.h" +#include "llvm/Support/Signals.h" #include #include @@ -45,6 +48,10 @@ // main //---------------------------------------------------------------------- int main(int argc, char *argv[]) { + llvm::StringRef ToolName = argv[0]; + llvm::sys::PrintStackTraceOnErrorSignal(ToolName); + llvm::PrettyStackTraceProgram X(argc, argv); + int option_error = 0; const char *progname = argv[0]; if (argc < 2) {