summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/lldb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/lldb.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/lldb.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lldb/source/lldb.cpp b/contrib/llvm/tools/lldb/source/lldb.cpp
index 755baec..433d6fa 100644
--- a/contrib/llvm/tools/lldb/source/lldb.cpp
+++ b/contrib/llvm/tools/lldb/source/lldb.cpp
@@ -28,6 +28,8 @@
#include "llvm/Support/TargetSelect.h"
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
+#include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"
+#include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h"
#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
@@ -70,6 +72,8 @@
#endif
#if defined (_WIN32)
+#include "lldb/Host/windows/windows.h"
+#include "Plugins/Process/Windows/DynamicLoaderWindows.h"
#include "Plugins/Process/Windows/ProcessWindows.h"
#endif
@@ -81,6 +85,8 @@
#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
+#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
+#include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h"
using namespace lldb;
using namespace lldb_private;
@@ -102,6 +108,25 @@ lldb_private::Initialize ()
if (!g_inited)
{
g_inited = true;
+
+#if defined(_MSC_VER)
+ const char *disable_crash_dialog_var = getenv("LLDB_DISABLE_CRASH_DIALOG");
+ if (disable_crash_dialog_var && llvm::StringRef(disable_crash_dialog_var).equals_lower("true"))
+ {
+ // This will prevent Windows from displaying a dialog box requiring user interaction when
+ // LLDB crashes. This is mostly useful when automating LLDB, for example via the test
+ // suite, so that a crash in LLDB does not prevent completion of the test suite.
+ ::SetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
+
+ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
+ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
+ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
+ }
+#endif
+
Log::Initialize();
HostInfo::Initialize();
Timer::Initialize ();
@@ -116,6 +141,8 @@ lldb_private::Initialize ()
// Initialize plug-ins
ABISysV_x86_64::Initialize();
+ ABISysV_ppc::Initialize();
+ ABISysV_ppc64::Initialize();
DisassemblerLLVMC::Initialize();
ObjectContainerBSDArchive::Initialize();
ObjectFileELF::Initialize();
@@ -136,6 +163,8 @@ lldb_private::Initialize ()
#endif
JITLoaderGDB::Initialize();
ProcessElfCore::Initialize();
+ MemoryHistoryASan::Initialize();
+ AddressSanitizerRuntime::Initialize();
#if defined (__APPLE__)
//----------------------------------------------------------------------
@@ -161,6 +190,7 @@ lldb_private::Initialize ()
ProcessLinux::Initialize();
#endif
#if defined(_WIN32)
+ DynamicLoaderWindows::Initialize();
ProcessWindows::Initialize();
#endif
#if defined (__FreeBSD__)
@@ -198,6 +228,8 @@ lldb_private::Terminate ()
// Terminate and unload and loaded system or user LLDB plug-ins
PluginManager::Terminate();
ABISysV_x86_64::Terminate();
+ ABISysV_ppc::Terminate();
+ ABISysV_ppc64::Terminate();
DisassemblerLLVMC::Terminate();
ObjectContainerBSDArchive::Terminate();
ObjectFileELF::Terminate();
@@ -217,6 +249,8 @@ lldb_private::Terminate ()
#endif
JITLoaderGDB::Terminate();
ProcessElfCore::Terminate();
+ MemoryHistoryASan::Terminate();
+ AddressSanitizerRuntime::Terminate();
#if defined (__APPLE__)
DynamicLoaderMacOSXDYLD::Terminate();
@@ -235,6 +269,10 @@ lldb_private::Terminate ()
Debugger::SettingsTerminate ();
+#if defined (_WIN32)
+ DynamicLoaderWindows::Terminate();
+#endif
+
#if defined (__linux__)
ProcessLinux::Terminate();
#endif
@@ -396,6 +434,7 @@ lldb_private::GetSectionTypeAsCString (SectionType sect_type)
case eSectionTypeDWARFAppleNamespaces: return "apple-namespaces";
case eSectionTypeDWARFAppleObjC: return "apple-objc";
case eSectionTypeEHFrame: return "eh-frame";
+ case eSectionTypeCompactUnwind: return "compact-unwind";
case eSectionTypeOther: return "regular";
}
return "unknown";
OpenPOWER on IntegriCloud