Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 1 | //===-- SystemInitializerFull.cpp -------------------------------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 9 | #if !defined(LLDB_DISABLE_PYTHON) |
| 10 | #include "Plugins/ScriptInterpreter/Python/lldb-python.h" |
| 11 | #endif |
| 12 | |
Alex Langford | d17cd90 | 2018-05-25 20:28:16 +0000 | [diff] [blame] | 13 | #include "SystemInitializerFull.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 14 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 15 | #include "lldb/API/SBCommandInterpreter.h" |
| 16 | |
| 17 | #if !defined(LLDB_DISABLE_PYTHON) |
| 18 | #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" |
| 19 | #endif |
| 20 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 21 | #include "lldb/Core/Debugger.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 22 | #include "lldb/Host/Host.h" |
| 23 | #include "lldb/Initialization/SystemInitializerCommon.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 24 | #include "lldb/Interpreter/CommandInterpreter.h" |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 25 | #include "lldb/Symbol/ClangASTContext.h" |
Pavel Labath | 38d0632 | 2017-06-29 14:32:17 +0000 | [diff] [blame] | 26 | #include "lldb/Utility/Timer.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 27 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 28 | #include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h" |
| 29 | #include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 30 | #include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h" |
Omair Javaid | 52f825b | 2015-04-29 10:49:45 +0000 | [diff] [blame] | 31 | #include "Plugins/ABI/SysV-arm/ABISysV_arm.h" |
Omair Javaid | b78e05f | 2015-04-29 11:52:35 +0000 | [diff] [blame] | 32 | #include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h" |
Ted Woodward | bff0a21 | 2015-12-10 17:53:07 +0000 | [diff] [blame] | 33 | #include "Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h" |
Greg Clayton | b289cba | 2015-06-25 17:50:15 +0000 | [diff] [blame] | 34 | #include "Plugins/ABI/SysV-i386/ABISysV_i386.h" |
Bhushan D. Attarde | a8219f2 | 2015-06-18 07:02:10 +0000 | [diff] [blame] | 35 | #include "Plugins/ABI/SysV-mips/ABISysV_mips.h" |
Bhushan D. Attarde | 13f5425 | 2015-06-19 04:25:07 +0000 | [diff] [blame] | 36 | #include "Plugins/ABI/SysV-mips64/ABISysV_mips64.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 37 | #include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h" |
| 38 | #include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h" |
Ulrich Weigand | bb00d0b | 2016-04-14 14:28:34 +0000 | [diff] [blame] | 39 | #include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 40 | #include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h" |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 41 | #include "Plugins/Architecture/Arm/ArchitectureArm.h" |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 42 | #include "Plugins/Architecture/Mips/ArchitectureMips.h" |
Jim Ingham | 0858126 | 2018-03-12 21:17:04 +0000 | [diff] [blame] | 43 | #include "Plugins/Architecture/PPC64/ArchitecturePPC64.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 44 | #include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h" |
Jason Molenda | 9ab5dc2 | 2016-07-21 08:30:55 +0000 | [diff] [blame] | 45 | #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 46 | #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 47 | #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 48 | #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 49 | #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 50 | #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 51 | #include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h" |
Pavel Labath | 2a1c09f | 2017-06-26 08:13:22 +0000 | [diff] [blame] | 52 | #include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h" |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 53 | #include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h" |
Pavel Labath | 2a1c09f | 2017-06-26 08:13:22 +0000 | [diff] [blame] | 54 | #include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h" |
| 55 | #include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 56 | #include "Plugins/JITLoader/GDB/JITLoaderGDB.h" |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 57 | #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" |
| 58 | #include "Plugins/Language/ObjC/ObjCLanguage.h" |
| 59 | #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 60 | #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.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 | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 65 | #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h" |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 66 | #include "Plugins/ObjectFile/ELF/ObjectFileELF.h" |
| 67 | #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" |
| 68 | #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 69 | #include "Plugins/OperatingSystem/Python/OperatingSystemPython.h" |
| 70 | #include "Plugins/Platform/Android/PlatformAndroid.h" |
| 71 | #include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h" |
| 72 | #include "Plugins/Platform/Kalimba/PlatformKalimba.h" |
| 73 | #include "Plugins/Platform/Linux/PlatformLinux.h" |
| 74 | #include "Plugins/Platform/MacOSX/PlatformMacOSX.h" |
| 75 | #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h" |
| 76 | #include "Plugins/Platform/NetBSD/PlatformNetBSD.h" |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 77 | #include "Plugins/Platform/OpenBSD/PlatformOpenBSD.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 78 | #include "Plugins/Platform/Windows/PlatformWindows.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 79 | #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" |
| 80 | #include "Plugins/Process/elf-core/ProcessElfCore.h" |
| 81 | #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 82 | #include "Plugins/Process/mach-core/ProcessMachCore.h" |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 83 | #include "Plugins/Process/minidump/ProcessMinidump.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 84 | #include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 85 | #include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 86 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" |
| 87 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 88 | #include "Plugins/SymbolFile/PDB/SymbolFilePDB.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 89 | #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" |
| 90 | #include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h" |
| 91 | #include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 92 | #include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 93 | #include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 94 | |
| 95 | #if defined(__APPLE__) |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 96 | #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h" |
Jason Molenda | 5e88be9 | 2015-11-06 00:22:53 +0000 | [diff] [blame] | 97 | #include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h" |
| 98 | #include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 99 | #include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h" |
Jason Molenda | 5e88be9 | 2015-11-06 00:22:53 +0000 | [diff] [blame] | 100 | #include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h" |
| 101 | #include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h" |
Jason Molenda | 32762fd | 2018-10-11 00:28:35 +0000 | [diff] [blame] | 102 | #include "Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 103 | #include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h" |
| 104 | #include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 105 | #include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 106 | #endif |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 107 | #include "Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 108 | |
| 109 | #if defined(__FreeBSD__) |
| 110 | #include "Plugins/Process/FreeBSD/ProcessFreeBSD.h" |
| 111 | #endif |
| 112 | |
Hafiz Abid Qadeer | f6ee79c | 2016-12-15 15:00:41 +0000 | [diff] [blame] | 113 | #if defined(_WIN32) |
Adrian McCarthy | 4ad5def | 2016-11-23 16:26:37 +0000 | [diff] [blame] | 114 | #include "Plugins/Process/Windows/Common/ProcessWindows.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 115 | #include "lldb/Host/windows/windows.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 116 | #endif |
| 117 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 118 | #include "llvm/Support/TargetSelect.h" |
| 119 | |
| 120 | #include <string> |
| 121 | |
| 122 | using namespace lldb_private; |
| 123 | |
| 124 | #ifndef LLDB_DISABLE_PYTHON |
| 125 | |
| 126 | // Defined in the SWIG source file |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 127 | #if PY_MAJOR_VERSION >= 3 |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 128 | extern "C" PyObject *PyInit__lldb(void); |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 129 | |
| 130 | #define LLDBSwigPyInit PyInit__lldb |
| 131 | |
| 132 | #else |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 133 | extern "C" void init_lldb(void); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 134 | |
Zachary Turner | c5b41d6 | 2015-10-16 17:52:03 +0000 | [diff] [blame] | 135 | #define LLDBSwigPyInit init_lldb |
| 136 | #endif |
| 137 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 138 | // these are the Pythonic implementations of the required callbacks these are |
| 139 | // scripting-language specific, which is why they belong here we still need to |
| 140 | // use function pointers to them instead of relying on linkage-time resolution |
| 141 | // because the SWIG stuff and this file get built at different times |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 142 | extern "C" bool LLDBSwigPythonBreakpointCallbackFunction( |
| 143 | const char *python_function_name, const char *session_dictionary_name, |
| 144 | const lldb::StackFrameSP &sb_frame, |
| 145 | const lldb::BreakpointLocationSP &sb_bp_loc); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 146 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 147 | extern "C" bool LLDBSwigPythonWatchpointCallbackFunction( |
| 148 | const char *python_function_name, const char *session_dictionary_name, |
| 149 | const lldb::StackFrameSP &sb_frame, const lldb::WatchpointSP &sb_wp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 150 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 151 | extern "C" bool LLDBSwigPythonCallTypeScript( |
| 152 | const char *python_function_name, void *session_dictionary, |
| 153 | const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper, |
| 154 | const lldb::TypeSummaryOptionsSP &options_sp, std::string &retval); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 155 | |
| 156 | extern "C" void * |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 157 | LLDBSwigPythonCreateSyntheticProvider(const char *python_class_name, |
| 158 | const char *session_dictionary_name, |
| 159 | const lldb::ValueObjectSP &valobj_sp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 160 | |
| 161 | extern "C" void * |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 162 | LLDBSwigPythonCreateCommandObject(const char *python_class_name, |
| 163 | const char *session_dictionary_name, |
| 164 | const lldb::DebuggerSP debugger_sp); |
| 165 | |
| 166 | extern "C" void *LLDBSwigPythonCreateScriptedThreadPlan( |
| 167 | const char *python_class_name, const char *session_dictionary_name, |
| 168 | const lldb::ThreadPlanSP &thread_plan_sp); |
| 169 | |
| 170 | extern "C" bool LLDBSWIGPythonCallThreadPlan(void *implementor, |
| 171 | const char *method_name, |
| 172 | Event *event_sp, bool &got_error); |
Jonas Devlieghere | 77198bc | 2018-11-05 19:33:59 +0000 | [diff] [blame] | 173 | |
Jim Ingham | 3815e70 | 2018-09-13 21:35:32 +0000 | [diff] [blame] | 174 | extern "C" void *LLDBSwigPythonCreateScriptedBreakpointResolver( |
| 175 | const char *python_class_name, |
| 176 | const char *session_dictionary_name, |
| 177 | lldb_private::StructuredDataImpl *args, |
| 178 | lldb::BreakpointSP &bkpt_sp); |
| 179 | |
| 180 | extern "C" unsigned int LLDBSwigPythonCallBreakpointResolver( |
| 181 | void *implementor, |
| 182 | const char *method_name, |
| 183 | lldb_private::SymbolContext *sym_ctx |
| 184 | ); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 185 | |
| 186 | extern "C" size_t LLDBSwigPython_CalculateNumChildren(void *implementor, |
| 187 | uint32_t max); |
| 188 | |
| 189 | extern "C" void *LLDBSwigPython_GetChildAtIndex(void *implementor, |
| 190 | uint32_t idx); |
| 191 | |
| 192 | extern "C" int LLDBSwigPython_GetIndexOfChildWithName(void *implementor, |
| 193 | const char *child_name); |
| 194 | |
| 195 | extern "C" void *LLDBSWIGPython_CastPyObjectToSBValue(void *data); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 196 | |
| 197 | extern lldb::ValueObjectSP |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 198 | LLDBSWIGPython_GetValueObjectSPFromSBValue(void *data); |
| 199 | |
| 200 | extern "C" bool LLDBSwigPython_UpdateSynthProviderInstance(void *implementor); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 201 | |
| 202 | extern "C" bool |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 203 | LLDBSwigPython_MightHaveChildrenSynthProviderInstance(void *implementor); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 204 | |
| 205 | extern "C" void * |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 206 | LLDBSwigPython_GetValueSynthProviderInstance(void *implementor); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 207 | |
| 208 | extern "C" bool |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 209 | LLDBSwigPythonCallCommand(const char *python_function_name, |
| 210 | const char *session_dictionary_name, |
| 211 | lldb::DebuggerSP &debugger, const char *args, |
| 212 | lldb_private::CommandReturnObject &cmd_retobj, |
| 213 | lldb::ExecutionContextRefSP exe_ctx_ref_sp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 214 | |
| 215 | extern "C" bool |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 216 | LLDBSwigPythonCallCommandObject(void *implementor, lldb::DebuggerSP &debugger, |
| 217 | const char *args, |
| 218 | lldb_private::CommandReturnObject &cmd_retobj, |
| 219 | lldb::ExecutionContextRefSP exe_ctx_ref_sp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 220 | |
| 221 | extern "C" bool |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 222 | LLDBSwigPythonCallModuleInit(const char *python_module_name, |
| 223 | const char *session_dictionary_name, |
| 224 | lldb::DebuggerSP &debugger); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 225 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 226 | extern "C" void * |
| 227 | LLDBSWIGPythonCreateOSPlugin(const char *python_class_name, |
| 228 | const char *session_dictionary_name, |
| 229 | const lldb::ProcessSP &process_sp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 230 | |
Kuba Mracek | 41ae8e7 | 2018-10-31 04:00:22 +0000 | [diff] [blame] | 231 | extern "C" void *LLDBSWIGPython_CreateFrameRecognizer( |
| 232 | const char *python_class_name, |
| 233 | const char *session_dictionary_name); |
| 234 | |
| 235 | extern "C" void *LLDBSwigPython_GetRecognizedArguments(void *implementor, |
| 236 | const lldb::StackFrameSP& frame_sp); |
| 237 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 238 | extern "C" bool LLDBSWIGPythonRunScriptKeywordProcess( |
| 239 | const char *python_function_name, const char *session_dictionary_name, |
| 240 | lldb::ProcessSP &process, std::string &output); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 241 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 242 | extern "C" bool LLDBSWIGPythonRunScriptKeywordThread( |
| 243 | const char *python_function_name, const char *session_dictionary_name, |
| 244 | lldb::ThreadSP &thread, std::string &output); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 245 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 246 | extern "C" bool LLDBSWIGPythonRunScriptKeywordTarget( |
| 247 | const char *python_function_name, const char *session_dictionary_name, |
| 248 | lldb::TargetSP &target, std::string &output); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 249 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 250 | extern "C" bool LLDBSWIGPythonRunScriptKeywordFrame( |
| 251 | const char *python_function_name, const char *session_dictionary_name, |
| 252 | lldb::StackFrameSP &frame, std::string &output); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 253 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 254 | extern "C" bool LLDBSWIGPythonRunScriptKeywordValue( |
| 255 | const char *python_function_name, const char *session_dictionary_name, |
| 256 | lldb::ValueObjectSP &value, std::string &output); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 257 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 258 | extern "C" void * |
| 259 | LLDBSWIGPython_GetDynamicSetting(void *module, const char *setting, |
| 260 | const lldb::TargetSP &target_sp); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 261 | |
| 262 | #endif |
| 263 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 264 | SystemInitializerFull::SystemInitializerFull() {} |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 265 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 266 | SystemInitializerFull::~SystemInitializerFull() {} |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 267 | |
Jonas Devlieghere | 15eacd7 | 2018-12-03 17:28:29 +0000 | [diff] [blame] | 268 | llvm::Error |
| 269 | SystemInitializerFull::Initialize(const InitializerOptions &options) { |
| 270 | if (auto e = SystemInitializerCommon::Initialize(options)) |
| 271 | return e; |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 272 | |
Pavel Labath | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 273 | breakpad::ObjectFileBreakpad::Initialize(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 274 | ObjectFileELF::Initialize(); |
| 275 | ObjectFileMachO::Initialize(); |
| 276 | ObjectFilePECOFF::Initialize(); |
| 277 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 278 | ScriptInterpreterNone::Initialize(); |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 279 | |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 280 | #ifndef LLDB_DISABLE_PYTHON |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 281 | OperatingSystemPython::Initialize(); |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 282 | #endif |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 283 | |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 284 | #if !defined(LLDB_DISABLE_PYTHON) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 285 | InitializeSWIG(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 286 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 287 | // ScriptInterpreterPython::Initialize() depends on things like HostInfo |
| 288 | // being initialized so it can compute the python directory etc, so we need |
| 289 | // to do this after SystemInitializerCommon::Initialize(). |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 290 | ScriptInterpreterPython::Initialize(); |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 291 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 292 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 293 | platform_freebsd::PlatformFreeBSD::Initialize(); |
| 294 | platform_linux::PlatformLinux::Initialize(); |
| 295 | platform_netbsd::PlatformNetBSD::Initialize(); |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 296 | platform_openbsd::PlatformOpenBSD::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 297 | PlatformWindows::Initialize(); |
| 298 | PlatformKalimba::Initialize(); |
| 299 | platform_android::PlatformAndroid::Initialize(); |
| 300 | PlatformRemoteiOS::Initialize(); |
| 301 | PlatformMacOSX::Initialize(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 302 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 303 | PlatformiOSSimulator::Initialize(); |
| 304 | PlatformDarwinKernel::Initialize(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 305 | #endif |
| 306 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 307 | // Initialize LLVM and Clang |
| 308 | llvm::InitializeAllTargets(); |
| 309 | llvm::InitializeAllAsmPrinters(); |
| 310 | llvm::InitializeAllTargetMCs(); |
| 311 | llvm::InitializeAllDisassemblers(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 312 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 313 | ClangASTContext::Initialize(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 314 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 315 | ABIMacOSX_i386::Initialize(); |
| 316 | ABIMacOSX_arm::Initialize(); |
| 317 | ABIMacOSX_arm64::Initialize(); |
| 318 | ABISysV_arm::Initialize(); |
| 319 | ABISysV_arm64::Initialize(); |
| 320 | ABISysV_hexagon::Initialize(); |
| 321 | ABISysV_i386::Initialize(); |
| 322 | ABISysV_x86_64::Initialize(); |
| 323 | ABISysV_ppc::Initialize(); |
| 324 | ABISysV_ppc64::Initialize(); |
| 325 | ABISysV_mips::Initialize(); |
| 326 | ABISysV_mips64::Initialize(); |
| 327 | ABISysV_s390x::Initialize(); |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 328 | |
| 329 | ArchitectureArm::Initialize(); |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 330 | ArchitectureMips::Initialize(); |
Jim Ingham | 0858126 | 2018-03-12 21:17:04 +0000 | [diff] [blame] | 331 | ArchitecturePPC64::Initialize(); |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 332 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 333 | DisassemblerLLVMC::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 334 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 335 | JITLoaderGDB::Initialize(); |
| 336 | ProcessElfCore::Initialize(); |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 337 | ProcessMachCore::Initialize(); |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 338 | minidump::ProcessMinidump::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 339 | MemoryHistoryASan::Initialize(); |
| 340 | AddressSanitizerRuntime::Initialize(); |
| 341 | ThreadSanitizerRuntime::Initialize(); |
Kuba Mracek | ef45d8b | 2017-06-16 20:59:08 +0000 | [diff] [blame] | 342 | UndefinedBehaviorSanitizerRuntime::Initialize(); |
| 343 | MainThreadCheckerRuntime::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 344 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 345 | SymbolVendorELF::Initialize(); |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 346 | breakpad::SymbolFileBreakpad::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 347 | SymbolFileDWARF::Initialize(); |
| 348 | SymbolFilePDB::Initialize(); |
| 349 | SymbolFileSymtab::Initialize(); |
| 350 | UnwindAssemblyInstEmulation::Initialize(); |
| 351 | UnwindAssembly_x86::Initialize(); |
| 352 | EmulateInstructionARM64::Initialize(); |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 353 | EmulateInstructionPPC64::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 354 | SymbolFileDWARFDebugMap::Initialize(); |
| 355 | ItaniumABILanguageRuntime::Initialize(); |
| 356 | AppleObjCRuntimeV2::Initialize(); |
| 357 | AppleObjCRuntimeV1::Initialize(); |
| 358 | SystemRuntimeMacOSX::Initialize(); |
| 359 | RenderScriptRuntime::Initialize(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 360 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 361 | CPlusPlusLanguage::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 362 | ObjCLanguage::Initialize(); |
| 363 | ObjCPlusPlusLanguage::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 364 | |
Hafiz Abid Qadeer | f6ee79c | 2016-12-15 15:00:41 +0000 | [diff] [blame] | 365 | #if defined(_WIN32) |
Adrian McCarthy | 4ad5def | 2016-11-23 16:26:37 +0000 | [diff] [blame] | 366 | ProcessWindows::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 367 | #endif |
| 368 | #if defined(__FreeBSD__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 369 | ProcessFreeBSD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 370 | #endif |
| 371 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 372 | SymbolVendorMacOSX::Initialize(); |
| 373 | ProcessKDP::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 374 | PlatformAppleTVSimulator::Initialize(); |
| 375 | PlatformAppleWatchSimulator::Initialize(); |
| 376 | PlatformRemoteAppleTV::Initialize(); |
| 377 | PlatformRemoteAppleWatch::Initialize(); |
Jason Molenda | 32762fd | 2018-10-11 00:28:35 +0000 | [diff] [blame] | 378 | PlatformRemoteAppleBridge::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 379 | DynamicLoaderDarwinKernel::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 380 | #endif |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 381 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 382 | // This plugin is valid on any host that talks to a Darwin remote. It |
| 383 | // shouldn't be limited to __APPLE__. |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 384 | StructuredDataDarwinLog::Initialize(); |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 385 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 386 | //---------------------------------------------------------------------- |
| 387 | // Platform agnostic plugins |
| 388 | //---------------------------------------------------------------------- |
| 389 | platform_gdb_server::PlatformRemoteGDBServer::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 390 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 391 | process_gdb_remote::ProcessGDBRemote::Initialize(); |
| 392 | DynamicLoaderMacOSXDYLD::Initialize(); |
| 393 | DynamicLoaderMacOS::Initialize(); |
| 394 | DynamicLoaderPOSIXDYLD::Initialize(); |
| 395 | DynamicLoaderStatic::Initialize(); |
| 396 | DynamicLoaderWindowsDYLD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 397 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 398 | // Scan for any system or user LLDB plug-ins |
| 399 | PluginManager::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 400 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 401 | // The process settings need to know about installed plug-ins, so the |
| 402 | // Settings must be initialized |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 403 | // AFTER PluginManager::Initialize is called. |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 404 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 405 | Debugger::SettingsInitialize(); |
Jonas Devlieghere | 15eacd7 | 2018-12-03 17:28:29 +0000 | [diff] [blame] | 406 | |
| 407 | return llvm::Error::success(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 408 | } |
| 409 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 410 | void SystemInitializerFull::InitializeSWIG() { |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 411 | #if !defined(LLDB_DISABLE_PYTHON) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 412 | ScriptInterpreterPython::InitializeInterpreter( |
| 413 | LLDBSwigPyInit, LLDBSwigPythonBreakpointCallbackFunction, |
| 414 | LLDBSwigPythonWatchpointCallbackFunction, LLDBSwigPythonCallTypeScript, |
| 415 | LLDBSwigPythonCreateSyntheticProvider, LLDBSwigPythonCreateCommandObject, |
| 416 | LLDBSwigPython_CalculateNumChildren, LLDBSwigPython_GetChildAtIndex, |
| 417 | LLDBSwigPython_GetIndexOfChildWithName, |
| 418 | LLDBSWIGPython_CastPyObjectToSBValue, |
| 419 | LLDBSWIGPython_GetValueObjectSPFromSBValue, |
| 420 | LLDBSwigPython_UpdateSynthProviderInstance, |
| 421 | LLDBSwigPython_MightHaveChildrenSynthProviderInstance, |
| 422 | LLDBSwigPython_GetValueSynthProviderInstance, LLDBSwigPythonCallCommand, |
| 423 | LLDBSwigPythonCallCommandObject, LLDBSwigPythonCallModuleInit, |
Kuba Mracek | 41ae8e7 | 2018-10-31 04:00:22 +0000 | [diff] [blame] | 424 | LLDBSWIGPythonCreateOSPlugin, LLDBSWIGPython_CreateFrameRecognizer, |
| 425 | LLDBSwigPython_GetRecognizedArguments, |
| 426 | LLDBSWIGPythonRunScriptKeywordProcess, |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 427 | LLDBSWIGPythonRunScriptKeywordThread, |
| 428 | LLDBSWIGPythonRunScriptKeywordTarget, LLDBSWIGPythonRunScriptKeywordFrame, |
| 429 | LLDBSWIGPythonRunScriptKeywordValue, LLDBSWIGPython_GetDynamicSetting, |
Jim Ingham | 3815e70 | 2018-09-13 21:35:32 +0000 | [diff] [blame] | 430 | LLDBSwigPythonCreateScriptedThreadPlan, LLDBSWIGPythonCallThreadPlan, |
| 431 | LLDBSwigPythonCreateScriptedBreakpointResolver, LLDBSwigPythonCallBreakpointResolver); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 432 | #endif |
| 433 | } |
| 434 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 435 | void SystemInitializerFull::Terminate() { |
Pavel Labath | f9d1647 | 2017-05-15 13:02:37 +0000 | [diff] [blame] | 436 | static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); |
| 437 | Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 438 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 439 | Debugger::SettingsTerminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 440 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 441 | // Terminate and unload and loaded system or user LLDB plug-ins |
| 442 | PluginManager::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 443 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 444 | ClangASTContext::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 445 | |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 446 | ArchitectureArm::Terminate(); |
| 447 | ArchitectureMips::Terminate(); |
| 448 | ArchitecturePPC64::Terminate(); |
| 449 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 450 | ABIMacOSX_i386::Terminate(); |
| 451 | ABIMacOSX_arm::Terminate(); |
| 452 | ABIMacOSX_arm64::Terminate(); |
| 453 | ABISysV_arm::Terminate(); |
| 454 | ABISysV_arm64::Terminate(); |
| 455 | ABISysV_hexagon::Terminate(); |
| 456 | ABISysV_i386::Terminate(); |
| 457 | ABISysV_x86_64::Terminate(); |
| 458 | ABISysV_ppc::Terminate(); |
| 459 | ABISysV_ppc64::Terminate(); |
| 460 | ABISysV_mips::Terminate(); |
| 461 | ABISysV_mips64::Terminate(); |
| 462 | ABISysV_s390x::Terminate(); |
| 463 | DisassemblerLLVMC::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 464 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 465 | JITLoaderGDB::Terminate(); |
| 466 | ProcessElfCore::Terminate(); |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 467 | ProcessMachCore::Terminate(); |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 468 | minidump::ProcessMinidump::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 469 | MemoryHistoryASan::Terminate(); |
| 470 | AddressSanitizerRuntime::Terminate(); |
| 471 | ThreadSanitizerRuntime::Terminate(); |
Kuba Mracek | ef45d8b | 2017-06-16 20:59:08 +0000 | [diff] [blame] | 472 | UndefinedBehaviorSanitizerRuntime::Terminate(); |
| 473 | MainThreadCheckerRuntime::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 474 | SymbolVendorELF::Terminate(); |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 475 | breakpad::SymbolFileBreakpad::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 476 | SymbolFileDWARF::Terminate(); |
| 477 | SymbolFilePDB::Terminate(); |
| 478 | SymbolFileSymtab::Terminate(); |
| 479 | UnwindAssembly_x86::Terminate(); |
| 480 | UnwindAssemblyInstEmulation::Terminate(); |
| 481 | EmulateInstructionARM64::Terminate(); |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 482 | EmulateInstructionPPC64::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 483 | SymbolFileDWARFDebugMap::Terminate(); |
| 484 | ItaniumABILanguageRuntime::Terminate(); |
| 485 | AppleObjCRuntimeV2::Terminate(); |
| 486 | AppleObjCRuntimeV1::Terminate(); |
| 487 | SystemRuntimeMacOSX::Terminate(); |
| 488 | RenderScriptRuntime::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 489 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 490 | CPlusPlusLanguage::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 491 | ObjCLanguage::Terminate(); |
| 492 | ObjCPlusPlusLanguage::Terminate(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 493 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 494 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 495 | DynamicLoaderDarwinKernel::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 496 | ProcessKDP::Terminate(); |
| 497 | SymbolVendorMacOSX::Terminate(); |
| 498 | PlatformAppleTVSimulator::Terminate(); |
| 499 | PlatformAppleWatchSimulator::Terminate(); |
| 500 | PlatformRemoteAppleTV::Terminate(); |
| 501 | PlatformRemoteAppleWatch::Terminate(); |
Jason Molenda | 32762fd | 2018-10-11 00:28:35 +0000 | [diff] [blame] | 502 | PlatformRemoteAppleBridge::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 503 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 504 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 505 | #if defined(__FreeBSD__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 506 | ProcessFreeBSD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 507 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 508 | Debugger::SettingsTerminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 509 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 510 | platform_gdb_server::PlatformRemoteGDBServer::Terminate(); |
| 511 | process_gdb_remote::ProcessGDBRemote::Terminate(); |
| 512 | StructuredDataDarwinLog::Terminate(); |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 513 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 514 | DynamicLoaderMacOSXDYLD::Terminate(); |
| 515 | DynamicLoaderMacOS::Terminate(); |
| 516 | DynamicLoaderPOSIXDYLD::Terminate(); |
| 517 | DynamicLoaderStatic::Terminate(); |
| 518 | DynamicLoaderWindowsDYLD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 519 | |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 520 | #ifndef LLDB_DISABLE_PYTHON |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 521 | OperatingSystemPython::Terminate(); |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 522 | #endif |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 523 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 524 | platform_freebsd::PlatformFreeBSD::Terminate(); |
| 525 | platform_linux::PlatformLinux::Terminate(); |
| 526 | platform_netbsd::PlatformNetBSD::Terminate(); |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 527 | platform_openbsd::PlatformOpenBSD::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 528 | PlatformWindows::Terminate(); |
| 529 | PlatformKalimba::Terminate(); |
| 530 | platform_android::PlatformAndroid::Terminate(); |
| 531 | PlatformMacOSX::Terminate(); |
| 532 | PlatformRemoteiOS::Terminate(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 533 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 534 | PlatformiOSSimulator::Terminate(); |
| 535 | PlatformDarwinKernel::Terminate(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 536 | #endif |
| 537 | |
Pavel Labath | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 538 | breakpad::ObjectFileBreakpad::Terminate(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 539 | ObjectFileELF::Terminate(); |
| 540 | ObjectFileMachO::Terminate(); |
| 541 | ObjectFilePECOFF::Terminate(); |
| 542 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 543 | // Now shutdown the common parts, in reverse order. |
| 544 | SystemInitializerCommon::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 545 | } |