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