diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp | 84 |
1 files changed, 69 insertions, 15 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp b/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp index 80a87d4..1616b47 100644 --- a/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp +++ b/contrib/llvm/tools/lldb/source/API/SystemInitializerFull.cpp @@ -7,12 +7,25 @@ // //===----------------------------------------------------------------------===// +#if !defined(LLDB_DISABLE_PYTHON) +#include "Plugins/ScriptInterpreter/Python/lldb-python.h" +#endif + #include "lldb/API/SystemInitializerFull.h" +#include "lldb/API/SBCommandInterpreter.h" + +#if !defined(LLDB_DISABLE_PYTHON) +#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" +#endif + #include "lldb/Core/Debugger.h" #include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Initialization/SystemInitializerCommon.h" +#include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Symbol/ClangASTContext.h" +#include "lldb/Symbol/GoASTContext.h" #include "Plugins/ABI/SysV-arm/ABISysV_arm.h" #include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h" @@ -27,11 +40,13 @@ #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" #include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h" #include "Plugins/JITLoader/GDB/JITLoaderGDB.h" +#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" #include "Plugins/Process/elf-core/ProcessElfCore.h" #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" +#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" @@ -42,6 +57,10 @@ #if defined(__APPLE__) #include "Plugins/Process/mach-core/ProcessMachCore.h" #include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h" +#include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h" +#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h" +#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h" +#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h" #endif #if defined(__FreeBSD__) @@ -50,11 +69,8 @@ #if defined(_MSC_VER) #include "lldb/Host/windows/windows.h" -#include "Plugins/Process/Windows/ProcessWindows.h" -#endif - -#if !defined(LLDB_DISABLE_PYTHON) -#include "lldb/Interpreter/ScriptInterpreterPython.h" +#include "Plugins/Process/Windows/Live/ProcessWindowsLive.h" +#include "Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h" #endif #include "llvm/Support/TargetSelect.h" @@ -66,9 +82,19 @@ using namespace lldb_private; #ifndef LLDB_DISABLE_PYTHON // Defined in the SWIG source file -extern "C" void +#if PY_MAJOR_VERSION >= 3 +extern "C" PyObject* +PyInit__lldb(void); + +#define LLDBSwigPyInit PyInit__lldb + +#else +extern "C" void init_lldb(void); +#define LLDBSwigPyInit init_lldb +#endif + // these are the Pythonic implementations of the required callbacks // these are scripting-language specific, which is why they belong here // we still need to use function pointers to them instead of relying @@ -116,7 +142,7 @@ LLDBSWIGPythonCallThreadPlan (void *implementor, bool &got_error); extern "C" size_t -LLDBSwigPython_CalculateNumChildren (void *implementor); +LLDBSwigPython_CalculateNumChildren (void *implementor, uint32_t max); extern "C" void * LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx); @@ -213,9 +239,17 @@ SystemInitializerFull::~SystemInitializerFull() void SystemInitializerFull::Initialize() { + SystemInitializerCommon::Initialize(); + ScriptInterpreterNone::Initialize(); + +#if !defined(LLDB_DISABLE_PYTHON) InitializeSWIG(); - SystemInitializerCommon::Initialize(); + // ScriptInterpreterPython::Initialize() depends on things like HostInfo being initialized + // so it can compute the python directory etc, so we need to do this after + // SystemInitializerCommon::Initialize(). + ScriptInterpreterPython::Initialize(); +#endif // Initialize LLVM and Clang llvm::InitializeAllTargets(); @@ -223,6 +257,9 @@ SystemInitializerFull::Initialize() llvm::InitializeAllTargetMCs(); llvm::InitializeAllDisassemblers(); + ClangASTContext::Initialize(); + GoASTContext::Initialize(); + ABISysV_arm::Initialize(); ABISysV_arm64::Initialize(); ABISysV_i386::Initialize(); @@ -235,6 +272,9 @@ SystemInitializerFull::Initialize() JITLoaderGDB::Initialize(); ProcessElfCore::Initialize(); +#if defined(_MSC_VER) + ProcessWinMiniDump::Initialize(); +#endif MemoryHistoryASan::Initialize(); AddressSanitizerRuntime::Initialize(); @@ -247,8 +287,10 @@ SystemInitializerFull::Initialize() SymbolFileDWARFDebugMap::Initialize(); ItaniumABILanguageRuntime::Initialize(); + CPlusPlusLanguage::Initialize(); + #if defined(_MSC_VER) - ProcessWindows::Initialize(); + ProcessWindowsLive::Initialize(); #endif #if defined(__FreeBSD__) ProcessFreeBSD::Initialize(); @@ -257,6 +299,10 @@ SystemInitializerFull::Initialize() SymbolVendorMacOSX::Initialize(); ProcessKDP::Initialize(); ProcessMachCore::Initialize(); + PlatformAppleTVSimulator::Initialize(); + PlatformAppleWatchSimulator::Initialize(); + PlatformRemoteAppleTV::Initialize(); + PlatformRemoteAppleWatch::Initialize(); #endif //---------------------------------------------------------------------- // Platform agnostic plugins @@ -279,7 +325,7 @@ void SystemInitializerFull::InitializeSWIG() { #if !defined(LLDB_DISABLE_PYTHON) ScriptInterpreterPython::InitializeInterpreter( - init_lldb, + LLDBSwigPyInit, LLDBSwigPythonBreakpointCallbackFunction, LLDBSwigPythonWatchpointCallbackFunction, LLDBSwigPythonCallTypeScript, @@ -317,6 +363,10 @@ SystemInitializerFull::Terminate() // Terminate and unload and loaded system or user LLDB plug-ins PluginManager::Terminate(); + + ClangASTContext::Terminate(); + GoASTContext::Terminate(); + ABISysV_arm::Terminate(); ABISysV_arm64::Terminate(); ABISysV_i386::Terminate(); @@ -329,6 +379,9 @@ SystemInitializerFull::Terminate() JITLoaderGDB::Terminate(); ProcessElfCore::Terminate(); +#if defined(_MSC_VER) + ProcessWinMiniDump::Terminate(); +#endif MemoryHistoryASan::Terminate(); AddressSanitizerRuntime::Terminate(); SymbolVendorELF::Terminate(); @@ -340,10 +393,16 @@ SystemInitializerFull::Terminate() SymbolFileDWARFDebugMap::Terminate(); ItaniumABILanguageRuntime::Terminate(); + CPlusPlusLanguage::Terminate(); + #if defined(__APPLE__) ProcessMachCore::Terminate(); ProcessKDP::Terminate(); SymbolVendorMacOSX::Terminate(); + PlatformAppleTVSimulator::Terminate(); + PlatformAppleWatchSimulator::Terminate(); + PlatformRemoteAppleTV::Terminate(); + PlatformRemoteAppleWatch::Terminate(); #endif #if defined(__FreeBSD__) @@ -358,8 +417,3 @@ SystemInitializerFull::Terminate() // Now shutdown the common parts, in reverse order. SystemInitializerCommon::Terminate(); } - -void SystemInitializerFull::TerminateSWIG() -{ - -} |