Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 1 | //===-- SystemInitializerFull.cpp -------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 10 | #if !defined(LLDB_DISABLE_PYTHON) |
| 11 | #include "Plugins/ScriptInterpreter/Python/lldb-python.h" |
| 12 | #endif |
| 13 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 14 | #include "lldb/API/SystemInitializerFull.h" |
| 15 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 16 | #include "lldb/API/SBCommandInterpreter.h" |
| 17 | |
| 18 | #if !defined(LLDB_DISABLE_PYTHON) |
| 19 | #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" |
| 20 | #endif |
| 21 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 22 | #include "lldb/Core/Debugger.h" |
| 23 | #include "lldb/Core/Timer.h" |
| 24 | #include "lldb/Host/Host.h" |
| 25 | #include "lldb/Initialization/SystemInitializerCommon.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 26 | #include "lldb/Interpreter/CommandInterpreter.h" |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 27 | #include "lldb/Symbol/ClangASTContext.h" |
| 28 | #include "lldb/Symbol/GoASTContext.h" |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 29 | #include "lldb/Symbol/JavaASTContext.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 30 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 31 | #include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h" |
| 32 | #include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 33 | #include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h" |
Omair Javaid | 52f825b | 2015-04-29 10:49:45 +0000 | [diff] [blame] | 34 | #include "Plugins/ABI/SysV-arm/ABISysV_arm.h" |
Omair Javaid | b78e05f | 2015-04-29 11:52:35 +0000 | [diff] [blame] | 35 | #include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h" |
Ted Woodward | bff0a21 | 2015-12-10 17:53:07 +0000 | [diff] [blame] | 36 | #include "Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h" |
Greg Clayton | b289cba | 2015-06-25 17:50:15 +0000 | [diff] [blame] | 37 | #include "Plugins/ABI/SysV-i386/ABISysV_i386.h" |
Bhushan D. Attarde | a8219f2 | 2015-06-18 07:02:10 +0000 | [diff] [blame] | 38 | #include "Plugins/ABI/SysV-mips/ABISysV_mips.h" |
Bhushan D. Attarde | 13f5425 | 2015-06-19 04:25:07 +0000 | [diff] [blame] | 39 | #include "Plugins/ABI/SysV-mips64/ABISysV_mips64.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 40 | #include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h" |
| 41 | #include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h" |
Ulrich Weigand | bb00d0b | 2016-04-14 14:28:34 +0000 | [diff] [blame^] | 42 | #include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 43 | #include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 44 | #include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h" |
| 45 | #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 46 | #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" |
| 47 | #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" |
| 48 | #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 49 | #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 50 | #include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h" |
Kuba Brecka | 6a83143 | 2016-03-23 15:36:22 +0000 | [diff] [blame] | 51 | #include "Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 52 | #include "Plugins/JITLoader/GDB/JITLoaderGDB.h" |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 53 | #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" |
Ryan Brown | 2dd8488 | 2015-11-05 00:24:36 +0000 | [diff] [blame] | 54 | #include "Plugins/Language/Go/GoLanguage.h" |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 55 | #include "Plugins/Language/Java/JavaLanguage.h" |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 56 | #include "Plugins/Language/ObjC/ObjCLanguage.h" |
| 57 | #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 58 | #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" |
Ryan Brown | 07a1c45 | 2015-10-06 20:29:31 +0000 | [diff] [blame] | 59 | #include "Plugins/LanguageRuntime/Go/GoLanguageRuntime.h" |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 60 | #include "Plugins/LanguageRuntime/Java/JavaLanguageRuntime.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 61 | #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h" |
| 62 | #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h" |
Colin Riley | 5ec532a | 2015-04-09 16:49:25 +0000 | [diff] [blame] | 63 | #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 64 | #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 65 | #include "Plugins/OperatingSystem/Python/OperatingSystemPython.h" |
| 66 | #include "Plugins/OperatingSystem/Go/OperatingSystemGo.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 67 | #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" |
| 68 | #include "Plugins/Process/elf-core/ProcessElfCore.h" |
| 69 | #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 70 | #include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 71 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" |
| 72 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 73 | #include "Plugins/SymbolFile/PDB/SymbolFilePDB.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 74 | #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" |
| 75 | #include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h" |
| 76 | #include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 77 | #include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 78 | #include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 79 | |
| 80 | #if defined(__APPLE__) |
| 81 | #include "Plugins/Process/mach-core/ProcessMachCore.h" |
| 82 | #include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h" |
| 83 | #include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h" |
Jason Molenda | 5e88be9 | 2015-11-06 00:22:53 +0000 | [diff] [blame] | 84 | #include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h" |
| 85 | #include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h" |
| 86 | #include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h" |
| 87 | #include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 88 | #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 89 | #endif |
| 90 | |
| 91 | #if defined(__FreeBSD__) |
| 92 | #include "Plugins/Process/FreeBSD/ProcessFreeBSD.h" |
| 93 | #endif |
| 94 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 95 | #if defined(_MSC_VER) |
| 96 | #include "lldb/Host/windows/windows.h" |
Adrian McCarthy | 18a9135d | 2015-10-28 18:21:45 +0000 | [diff] [blame] | 97 | #include "Plugins/Process/Windows/Live/ProcessWindowsLive.h" |
Adrian McCarthy | 27785dd | 2015-08-24 16:00:51 +0000 | [diff] [blame] | 98 | #include "Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 99 | #endif |
| 100 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 101 | #include "llvm/Support/TargetSelect.h" |
| 102 | |
| 103 | #include <string> |
| 104 | |
| 105 | using namespace lldb_private; |
| 106 | |
| 107 | #ifndef LLDB_DISABLE_PYTHON |
| 108 | |
| 109 | // Defined in the SWIG source file |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 110 | #if PY_MAJOR_VERSION >= 3 |
| 111 | extern "C" PyObject* |
| 112 | PyInit__lldb(void); |
| 113 | |
| 114 | #define LLDBSwigPyInit PyInit__lldb |
| 115 | |
| 116 | #else |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 117 | extern "C" void |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 118 | init_lldb(void); |
| 119 | |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 120 | #define LLDBSwigPyInit init_lldb |
| 121 | #endif |
| 122 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 123 | // these are the Pythonic implementations of the required callbacks |
| 124 | // these are scripting-language specific, which is why they belong here |
| 125 | // we still need to use function pointers to them instead of relying |
| 126 | // on linkage-time resolution because the SWIG stuff and this file |
| 127 | // get built at different times |
| 128 | extern "C" bool |
| 129 | LLDBSwigPythonBreakpointCallbackFunction (const char *python_function_name, |
| 130 | const char *session_dictionary_name, |
| 131 | const lldb::StackFrameSP& sb_frame, |
| 132 | const lldb::BreakpointLocationSP& sb_bp_loc); |
| 133 | |
| 134 | extern "C" bool |
| 135 | LLDBSwigPythonWatchpointCallbackFunction (const char *python_function_name, |
| 136 | const char *session_dictionary_name, |
| 137 | const lldb::StackFrameSP& sb_frame, |
| 138 | const lldb::WatchpointSP& sb_wp); |
| 139 | |
| 140 | extern "C" bool |
| 141 | LLDBSwigPythonCallTypeScript (const char *python_function_name, |
| 142 | void *session_dictionary, |
| 143 | const lldb::ValueObjectSP& valobj_sp, |
| 144 | void** pyfunct_wrapper, |
| 145 | const lldb::TypeSummaryOptionsSP& options_sp, |
| 146 | std::string& retval); |
| 147 | |
| 148 | extern "C" void* |
| 149 | LLDBSwigPythonCreateSyntheticProvider (const char *python_class_name, |
| 150 | const char *session_dictionary_name, |
| 151 | const lldb::ValueObjectSP& valobj_sp); |
| 152 | |
| 153 | extern "C" void* |
| 154 | LLDBSwigPythonCreateCommandObject (const char *python_class_name, |
| 155 | const char *session_dictionary_name, |
| 156 | const lldb::DebuggerSP debugger_sp); |
| 157 | |
| 158 | extern "C" void* |
| 159 | LLDBSwigPythonCreateScriptedThreadPlan (const char *python_class_name, |
| 160 | const char *session_dictionary_name, |
| 161 | const lldb::ThreadPlanSP& thread_plan_sp); |
| 162 | |
| 163 | extern "C" bool |
| 164 | LLDBSWIGPythonCallThreadPlan (void *implementor, |
| 165 | const char *method_name, |
| 166 | Event *event_sp, |
| 167 | bool &got_error); |
| 168 | |
| 169 | extern "C" size_t |
Siva Chandra | 9ac7a6c | 2015-10-21 19:28:08 +0000 | [diff] [blame] | 170 | LLDBSwigPython_CalculateNumChildren (void *implementor, uint32_t max); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 171 | |
| 172 | extern "C" void * |
| 173 | LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx); |
| 174 | |
| 175 | extern "C" int |
| 176 | LLDBSwigPython_GetIndexOfChildWithName (void *implementor, const char* child_name); |
| 177 | |
| 178 | extern "C" void * |
| 179 | LLDBSWIGPython_CastPyObjectToSBValue (void* data); |
| 180 | |
| 181 | extern lldb::ValueObjectSP |
| 182 | LLDBSWIGPython_GetValueObjectSPFromSBValue (void* data); |
| 183 | |
| 184 | extern "C" bool |
| 185 | LLDBSwigPython_UpdateSynthProviderInstance (void* implementor); |
| 186 | |
| 187 | extern "C" bool |
| 188 | LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void* implementor); |
| 189 | |
| 190 | extern "C" void * |
| 191 | LLDBSwigPython_GetValueSynthProviderInstance (void* implementor); |
| 192 | |
| 193 | extern "C" bool |
| 194 | LLDBSwigPythonCallCommand (const char *python_function_name, |
| 195 | const char *session_dictionary_name, |
| 196 | lldb::DebuggerSP& debugger, |
| 197 | const char* args, |
| 198 | lldb_private::CommandReturnObject &cmd_retobj, |
| 199 | lldb::ExecutionContextRefSP exe_ctx_ref_sp); |
| 200 | |
| 201 | extern "C" bool |
| 202 | LLDBSwigPythonCallCommandObject (void *implementor, |
| 203 | lldb::DebuggerSP& debugger, |
| 204 | const char* args, |
| 205 | lldb_private::CommandReturnObject& cmd_retobj, |
| 206 | lldb::ExecutionContextRefSP exe_ctx_ref_sp); |
| 207 | |
| 208 | extern "C" bool |
| 209 | LLDBSwigPythonCallModuleInit (const char *python_module_name, |
| 210 | const char *session_dictionary_name, |
| 211 | lldb::DebuggerSP& debugger); |
| 212 | |
| 213 | extern "C" void* |
| 214 | LLDBSWIGPythonCreateOSPlugin (const char *python_class_name, |
| 215 | const char *session_dictionary_name, |
| 216 | const lldb::ProcessSP& process_sp); |
| 217 | |
| 218 | extern "C" bool |
| 219 | LLDBSWIGPythonRunScriptKeywordProcess (const char* python_function_name, |
| 220 | const char* session_dictionary_name, |
| 221 | lldb::ProcessSP& process, |
| 222 | std::string& output); |
| 223 | |
| 224 | extern "C" bool |
| 225 | LLDBSWIGPythonRunScriptKeywordThread (const char* python_function_name, |
| 226 | const char* session_dictionary_name, |
| 227 | lldb::ThreadSP& thread, |
| 228 | std::string& output); |
| 229 | |
| 230 | extern "C" bool |
| 231 | LLDBSWIGPythonRunScriptKeywordTarget (const char* python_function_name, |
| 232 | const char* session_dictionary_name, |
| 233 | lldb::TargetSP& target, |
| 234 | std::string& output); |
| 235 | |
| 236 | extern "C" bool |
| 237 | LLDBSWIGPythonRunScriptKeywordFrame (const char* python_function_name, |
| 238 | const char* session_dictionary_name, |
| 239 | lldb::StackFrameSP& frame, |
| 240 | std::string& output); |
| 241 | |
| 242 | extern "C" bool |
| 243 | LLDBSWIGPythonRunScriptKeywordValue (const char* python_function_name, |
| 244 | const char* session_dictionary_name, |
| 245 | lldb::ValueObjectSP& value, |
| 246 | std::string& output); |
| 247 | |
| 248 | extern "C" void* |
| 249 | LLDBSWIGPython_GetDynamicSetting (void* module, |
| 250 | const char* setting, |
| 251 | const lldb::TargetSP& target_sp); |
| 252 | |
| 253 | |
| 254 | #endif |
| 255 | |
| 256 | SystemInitializerFull::SystemInitializerFull() |
| 257 | { |
| 258 | } |
| 259 | |
| 260 | SystemInitializerFull::~SystemInitializerFull() |
| 261 | { |
| 262 | } |
| 263 | |
| 264 | void |
| 265 | SystemInitializerFull::Initialize() |
| 266 | { |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 267 | SystemInitializerCommon::Initialize(); |
Keno Fischer | 6e77677 | 2015-08-23 09:05:29 +0000 | [diff] [blame] | 268 | ScriptInterpreterNone::Initialize(); |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 269 | |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 270 | #ifndef LLDB_DISABLE_PYTHON |
| 271 | OperatingSystemPython::Initialize(); |
| 272 | #endif |
| 273 | OperatingSystemGo::Initialize(); |
| 274 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 275 | #if !defined(LLDB_DISABLE_PYTHON) |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 276 | InitializeSWIG(); |
| 277 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 278 | // ScriptInterpreterPython::Initialize() depends on things like HostInfo being initialized |
| 279 | // so it can compute the python directory etc, so we need to do this after |
| 280 | // SystemInitializerCommon::Initialize(). |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 281 | ScriptInterpreterPython::Initialize(); |
| 282 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 283 | |
| 284 | // Initialize LLVM and Clang |
| 285 | llvm::InitializeAllTargets(); |
| 286 | llvm::InitializeAllAsmPrinters(); |
| 287 | llvm::InitializeAllTargetMCs(); |
| 288 | llvm::InitializeAllDisassemblers(); |
| 289 | |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 290 | ClangASTContext::Initialize(); |
| 291 | GoASTContext::Initialize(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 292 | JavaASTContext::Initialize(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 293 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 294 | ABIMacOSX_i386::Initialize(); |
| 295 | ABIMacOSX_arm::Initialize(); |
| 296 | ABIMacOSX_arm64::Initialize(); |
Omair Javaid | 52f825b | 2015-04-29 10:49:45 +0000 | [diff] [blame] | 297 | ABISysV_arm::Initialize(); |
Omair Javaid | b78e05f | 2015-04-29 11:52:35 +0000 | [diff] [blame] | 298 | ABISysV_arm64::Initialize(); |
Ted Woodward | bff0a21 | 2015-12-10 17:53:07 +0000 | [diff] [blame] | 299 | ABISysV_hexagon::Initialize(); |
Greg Clayton | b289cba | 2015-06-25 17:50:15 +0000 | [diff] [blame] | 300 | ABISysV_i386::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 301 | ABISysV_x86_64::Initialize(); |
| 302 | ABISysV_ppc::Initialize(); |
| 303 | ABISysV_ppc64::Initialize(); |
Bhushan D. Attarde | a8219f2 | 2015-06-18 07:02:10 +0000 | [diff] [blame] | 304 | ABISysV_mips::Initialize(); |
Bhushan D. Attarde | 13f5425 | 2015-06-19 04:25:07 +0000 | [diff] [blame] | 305 | ABISysV_mips64::Initialize(); |
Ulrich Weigand | bb00d0b | 2016-04-14 14:28:34 +0000 | [diff] [blame^] | 306 | ABISysV_s390x::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 307 | DisassemblerLLVMC::Initialize(); |
| 308 | |
| 309 | JITLoaderGDB::Initialize(); |
| 310 | ProcessElfCore::Initialize(); |
Adrian McCarthy | c96516f | 2015-08-03 23:01:51 +0000 | [diff] [blame] | 311 | #if defined(_MSC_VER) |
| 312 | ProcessWinMiniDump::Initialize(); |
| 313 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 314 | MemoryHistoryASan::Initialize(); |
| 315 | AddressSanitizerRuntime::Initialize(); |
Kuba Brecka | 6a83143 | 2016-03-23 15:36:22 +0000 | [diff] [blame] | 316 | ThreadSanitizerRuntime::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 317 | |
| 318 | SymbolVendorELF::Initialize(); |
| 319 | SymbolFileDWARF::Initialize(); |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 320 | SymbolFilePDB::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 321 | SymbolFileSymtab::Initialize(); |
| 322 | UnwindAssemblyInstEmulation::Initialize(); |
| 323 | UnwindAssembly_x86::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 324 | EmulateInstructionARM64::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 325 | SymbolFileDWARFDebugMap::Initialize(); |
| 326 | ItaniumABILanguageRuntime::Initialize(); |
| 327 | AppleObjCRuntimeV2::Initialize(); |
| 328 | AppleObjCRuntimeV1::Initialize(); |
| 329 | SystemRuntimeMacOSX::Initialize(); |
Colin Riley | 5ec532a | 2015-04-09 16:49:25 +0000 | [diff] [blame] | 330 | RenderScriptRuntime::Initialize(); |
Ryan Brown | 07a1c45 | 2015-10-06 20:29:31 +0000 | [diff] [blame] | 331 | GoLanguageRuntime::Initialize(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 332 | JavaLanguageRuntime::Initialize(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 333 | |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 334 | CPlusPlusLanguage::Initialize(); |
Ryan Brown | 2dd8488 | 2015-11-05 00:24:36 +0000 | [diff] [blame] | 335 | GoLanguage::Initialize(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 336 | JavaLanguage::Initialize(); |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 337 | ObjCLanguage::Initialize(); |
| 338 | ObjCPlusPlusLanguage::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 339 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 340 | #if defined(_MSC_VER) |
Adrian McCarthy | 18a9135d | 2015-10-28 18:21:45 +0000 | [diff] [blame] | 341 | ProcessWindowsLive::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 342 | #endif |
| 343 | #if defined(__FreeBSD__) |
| 344 | ProcessFreeBSD::Initialize(); |
| 345 | #endif |
| 346 | #if defined(__APPLE__) |
| 347 | SymbolVendorMacOSX::Initialize(); |
| 348 | ProcessKDP::Initialize(); |
| 349 | ProcessMachCore::Initialize(); |
Jason Molenda | 5e88be9 | 2015-11-06 00:22:53 +0000 | [diff] [blame] | 350 | PlatformAppleTVSimulator::Initialize(); |
| 351 | PlatformAppleWatchSimulator::Initialize(); |
| 352 | PlatformRemoteAppleTV::Initialize(); |
| 353 | PlatformRemoteAppleWatch::Initialize(); |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 354 | DynamicLoaderDarwinKernel::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 355 | #endif |
| 356 | //---------------------------------------------------------------------- |
| 357 | // Platform agnostic plugins |
| 358 | //---------------------------------------------------------------------- |
| 359 | platform_gdb_server::PlatformRemoteGDBServer::Initialize(); |
| 360 | |
| 361 | process_gdb_remote::ProcessGDBRemote::Initialize(); |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 362 | DynamicLoaderMacOSXDYLD::Initialize(); |
| 363 | DynamicLoaderPOSIXDYLD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 364 | DynamicLoaderStatic::Initialize(); |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 365 | DynamicLoaderWindowsDYLD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 366 | |
| 367 | // Scan for any system or user LLDB plug-ins |
| 368 | PluginManager::Initialize(); |
| 369 | |
| 370 | // The process settings need to know about installed plug-ins, so the Settings must be initialized |
| 371 | // AFTER PluginManager::Initialize is called. |
| 372 | |
| 373 | Debugger::SettingsInitialize(); |
| 374 | } |
| 375 | |
| 376 | void SystemInitializerFull::InitializeSWIG() |
| 377 | { |
| 378 | #if !defined(LLDB_DISABLE_PYTHON) |
| 379 | ScriptInterpreterPython::InitializeInterpreter( |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 380 | LLDBSwigPyInit, |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 381 | LLDBSwigPythonBreakpointCallbackFunction, |
| 382 | LLDBSwigPythonWatchpointCallbackFunction, |
| 383 | LLDBSwigPythonCallTypeScript, |
| 384 | LLDBSwigPythonCreateSyntheticProvider, |
| 385 | LLDBSwigPythonCreateCommandObject, |
| 386 | LLDBSwigPython_CalculateNumChildren, |
| 387 | LLDBSwigPython_GetChildAtIndex, |
| 388 | LLDBSwigPython_GetIndexOfChildWithName, |
| 389 | LLDBSWIGPython_CastPyObjectToSBValue, |
| 390 | LLDBSWIGPython_GetValueObjectSPFromSBValue, |
| 391 | LLDBSwigPython_UpdateSynthProviderInstance, |
| 392 | LLDBSwigPython_MightHaveChildrenSynthProviderInstance, |
| 393 | LLDBSwigPython_GetValueSynthProviderInstance, |
| 394 | LLDBSwigPythonCallCommand, |
| 395 | LLDBSwigPythonCallCommandObject, |
| 396 | LLDBSwigPythonCallModuleInit, |
| 397 | LLDBSWIGPythonCreateOSPlugin, |
| 398 | LLDBSWIGPythonRunScriptKeywordProcess, |
| 399 | LLDBSWIGPythonRunScriptKeywordThread, |
| 400 | LLDBSWIGPythonRunScriptKeywordTarget, |
| 401 | LLDBSWIGPythonRunScriptKeywordFrame, |
| 402 | LLDBSWIGPythonRunScriptKeywordValue, |
| 403 | LLDBSWIGPython_GetDynamicSetting, |
| 404 | LLDBSwigPythonCreateScriptedThreadPlan, |
| 405 | LLDBSWIGPythonCallThreadPlan); |
| 406 | #endif |
| 407 | } |
| 408 | |
| 409 | void |
| 410 | SystemInitializerFull::Terminate() |
| 411 | { |
| 412 | Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); |
| 413 | |
| 414 | Debugger::SettingsTerminate(); |
| 415 | |
| 416 | // Terminate and unload and loaded system or user LLDB plug-ins |
| 417 | PluginManager::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 418 | |
| 419 | ClangASTContext::Terminate(); |
| 420 | GoASTContext::Terminate(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 421 | JavaASTContext::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 422 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 423 | ABIMacOSX_i386::Terminate(); |
| 424 | ABIMacOSX_arm::Terminate(); |
| 425 | ABIMacOSX_arm64::Terminate(); |
Omair Javaid | 52f825b | 2015-04-29 10:49:45 +0000 | [diff] [blame] | 426 | ABISysV_arm::Terminate(); |
Omair Javaid | b78e05f | 2015-04-29 11:52:35 +0000 | [diff] [blame] | 427 | ABISysV_arm64::Terminate(); |
Ted Woodward | bff0a21 | 2015-12-10 17:53:07 +0000 | [diff] [blame] | 428 | ABISysV_hexagon::Terminate(); |
Greg Clayton | b289cba | 2015-06-25 17:50:15 +0000 | [diff] [blame] | 429 | ABISysV_i386::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 430 | ABISysV_x86_64::Terminate(); |
| 431 | ABISysV_ppc::Terminate(); |
| 432 | ABISysV_ppc64::Terminate(); |
Bhushan D. Attarde | a8219f2 | 2015-06-18 07:02:10 +0000 | [diff] [blame] | 433 | ABISysV_mips::Terminate(); |
Bhushan D. Attarde | 13f5425 | 2015-06-19 04:25:07 +0000 | [diff] [blame] | 434 | ABISysV_mips64::Terminate(); |
Ulrich Weigand | bb00d0b | 2016-04-14 14:28:34 +0000 | [diff] [blame^] | 435 | ABISysV_s390x::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 436 | DisassemblerLLVMC::Terminate(); |
| 437 | |
| 438 | JITLoaderGDB::Terminate(); |
| 439 | ProcessElfCore::Terminate(); |
Adrian McCarthy | c96516f | 2015-08-03 23:01:51 +0000 | [diff] [blame] | 440 | #if defined(_MSC_VER) |
| 441 | ProcessWinMiniDump::Terminate(); |
| 442 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 443 | MemoryHistoryASan::Terminate(); |
| 444 | AddressSanitizerRuntime::Terminate(); |
Kuba Brecka | 6a83143 | 2016-03-23 15:36:22 +0000 | [diff] [blame] | 445 | ThreadSanitizerRuntime::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 446 | SymbolVendorELF::Terminate(); |
| 447 | SymbolFileDWARF::Terminate(); |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 448 | SymbolFilePDB::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 449 | SymbolFileSymtab::Terminate(); |
| 450 | UnwindAssembly_x86::Terminate(); |
| 451 | UnwindAssemblyInstEmulation::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 452 | EmulateInstructionARM64::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 453 | SymbolFileDWARFDebugMap::Terminate(); |
| 454 | ItaniumABILanguageRuntime::Terminate(); |
| 455 | AppleObjCRuntimeV2::Terminate(); |
| 456 | AppleObjCRuntimeV1::Terminate(); |
| 457 | SystemRuntimeMacOSX::Terminate(); |
Colin Riley | 5ec532a | 2015-04-09 16:49:25 +0000 | [diff] [blame] | 458 | RenderScriptRuntime::Terminate(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 459 | JavaLanguageRuntime::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 460 | |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 461 | CPlusPlusLanguage::Terminate(); |
Ryan Brown | 2dd8488 | 2015-11-05 00:24:36 +0000 | [diff] [blame] | 462 | GoLanguage::Terminate(); |
Tamas Berghammer | 87a9769 | 2016-02-26 14:21:23 +0000 | [diff] [blame] | 463 | JavaLanguage::Terminate(); |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 464 | ObjCLanguage::Terminate(); |
| 465 | ObjCPlusPlusLanguage::Terminate(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 466 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 467 | #if defined(__APPLE__) |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 468 | DynamicLoaderDarwinKernel::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 469 | ProcessMachCore::Terminate(); |
| 470 | ProcessKDP::Terminate(); |
| 471 | SymbolVendorMacOSX::Terminate(); |
Jason Molenda | 5e88be9 | 2015-11-06 00:22:53 +0000 | [diff] [blame] | 472 | PlatformAppleTVSimulator::Terminate(); |
| 473 | PlatformAppleWatchSimulator::Terminate(); |
| 474 | PlatformRemoteAppleTV::Terminate(); |
| 475 | PlatformRemoteAppleWatch::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 476 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 477 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 478 | #if defined(__FreeBSD__) |
| 479 | ProcessFreeBSD::Terminate(); |
| 480 | #endif |
| 481 | Debugger::SettingsTerminate(); |
| 482 | |
| 483 | platform_gdb_server::PlatformRemoteGDBServer::Terminate(); |
| 484 | process_gdb_remote::ProcessGDBRemote::Terminate(); |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 485 | DynamicLoaderMacOSXDYLD::Terminate(); |
| 486 | DynamicLoaderPOSIXDYLD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 487 | DynamicLoaderStatic::Terminate(); |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 488 | DynamicLoaderWindowsDYLD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 489 | |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 490 | #ifndef LLDB_DISABLE_PYTHON |
| 491 | OperatingSystemPython::Terminate(); |
| 492 | #endif |
| 493 | OperatingSystemGo::Terminate(); |
| 494 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 495 | // Now shutdown the common parts, in reverse order. |
| 496 | SystemInitializerCommon::Terminate(); |
| 497 | } |