summaryrefslogtreecommitdiff
path: root/source/lldb.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
committerEd Maste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
commit205afe679855a4ce8149cdaa94d3f0868ce796dc (patch)
tree09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/lldb.cpp
parent0cac4ca3916ac24ab6139d03cbfd18db9e715bfe (diff)
Diffstat (limited to 'source/lldb.cpp')
-rw-r--r--source/lldb.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/source/lldb.cpp b/source/lldb.cpp
index cd620b7945b92..2ac8296b4d04a 100644
--- a/source/lldb.cpp
+++ b/source/lldb.cpp
@@ -31,6 +31,8 @@
#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"
#include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.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"
@@ -81,6 +83,8 @@
#endif
#if defined (_WIN32)
+#include "lldb/Host/windows/windows.h"
+#include "Plugins/Process/Windows/DynamicLoaderWindows.h"
#include "Plugins/Process/Windows/ProcessWindows.h"
#endif
@@ -92,6 +96,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;
@@ -113,6 +119,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 ();
@@ -130,6 +155,8 @@ lldb_private::Initialize ()
ABIMacOSX_arm::Initialize();
ABIMacOSX_arm64::Initialize();
ABISysV_x86_64::Initialize();
+ ABISysV_ppc::Initialize();
+ ABISysV_ppc64::Initialize();
DisassemblerLLVMC::Initialize();
ObjectContainerBSDArchive::Initialize();
ObjectFileELF::Initialize();
@@ -154,6 +181,8 @@ lldb_private::Initialize ()
#endif
JITLoaderGDB::Initialize();
ProcessElfCore::Initialize();
+ MemoryHistoryASan::Initialize();
+ AddressSanitizerRuntime::Initialize();
#if defined (__APPLE__)
//----------------------------------------------------------------------
@@ -181,6 +210,7 @@ lldb_private::Initialize ()
ProcessLinux::Initialize();
#endif
#if defined(_WIN32)
+ DynamicLoaderWindows::Initialize();
ProcessWindows::Initialize();
#endif
#if defined (__FreeBSD__)
@@ -221,6 +251,8 @@ lldb_private::Terminate ()
ABIMacOSX_arm::Terminate();
ABIMacOSX_arm64::Terminate();
ABISysV_x86_64::Terminate();
+ ABISysV_ppc::Terminate();
+ ABISysV_ppc64::Terminate();
DisassemblerLLVMC::Terminate();
ObjectContainerBSDArchive::Terminate();
ObjectFileELF::Terminate();
@@ -244,6 +276,8 @@ lldb_private::Terminate ()
#endif
JITLoaderGDB::Terminate();
ProcessElfCore::Terminate();
+ MemoryHistoryASan::Terminate();
+ AddressSanitizerRuntime::Terminate();
#if defined (__APPLE__)
DynamicLoaderMacOSXDYLD::Terminate();
@@ -264,6 +298,10 @@ lldb_private::Terminate ()
Debugger::SettingsTerminate ();
+#if defined (_WIN32)
+ DynamicLoaderWindows::Terminate();
+#endif
+
#if defined (__linux__)
ProcessLinux::Terminate();
#endif
@@ -425,6 +463,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";