Raphael Isemann | 8081428 | 2020-01-24 08:23:27 +0100 | [diff] [blame] | 1 | //===-- SystemInitializerFull.cpp -----------------------------------------===// |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 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 | |
Alex Langford | d17cd90 | 2018-05-25 20:28:16 +0000 | [diff] [blame] | 9 | #include "SystemInitializerFull.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 10 | #include "lldb/API/SBCommandInterpreter.h" |
Jonas Devlieghere | 59998b7 | 2019-12-10 08:54:30 -0800 | [diff] [blame] | 11 | #include "lldb/Host/Config.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 12 | |
Jonas Devlieghere | 4e26cf2 | 2019-12-13 10:37:33 -0800 | [diff] [blame] | 13 | #if LLDB_ENABLE_PYTHON |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 14 | #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" |
| 15 | #endif |
| 16 | |
Jonas Devlieghere | 67de8962 | 2019-12-07 15:49:35 -0800 | [diff] [blame] | 17 | #if LLDB_ENABLE_LUA |
| 18 | #include "Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.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" |
Pavel Labath | 38d0632 | 2017-06-29 14:32:17 +0000 | [diff] [blame] | 25 | #include "lldb/Utility/Timer.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 26 | |
Pavel Labath | e21b39a | 2020-02-02 08:48:51 +0100 | [diff] [blame] | 27 | #include "Plugins/ABI/AArch64/ABIMacOSX_arm64.h" |
| 28 | #include "Plugins/ABI/AArch64/ABISysV_arm64.h" |
| 29 | #include "Plugins/ABI/ARC/ABISysV_arc.h" |
| 30 | #include "Plugins/ABI/ARM/ABIMacOSX_arm.h" |
| 31 | #include "Plugins/ABI/ARM/ABISysV_arm.h" |
| 32 | #include "Plugins/ABI/Hexagon/ABISysV_hexagon.h" |
| 33 | #include "Plugins/ABI/Mips/ABISysV_mips.h" |
| 34 | #include "Plugins/ABI/Mips/ABISysV_mips64.h" |
| 35 | #include "Plugins/ABI/PowerPC/ABISysV_ppc.h" |
| 36 | #include "Plugins/ABI/PowerPC/ABISysV_ppc64.h" |
| 37 | #include "Plugins/ABI/SystemZ/ABISysV_s390x.h" |
| 38 | #include "Plugins/ABI/X86/ABIMacOSX_i386.h" |
| 39 | #include "Plugins/ABI/X86/ABISysV_i386.h" |
| 40 | #include "Plugins/ABI/X86/ABISysV_x86_64.h" |
| 41 | #include "Plugins/ABI/X86/ABIWindows_x86_64.h" |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 42 | #include "Plugins/Architecture/Arm/ArchitectureArm.h" |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 43 | #include "Plugins/Architecture/Mips/ArchitectureMips.h" |
Jim Ingham | 0858126 | 2018-03-12 21:17:04 +0000 | [diff] [blame] | 44 | #include "Plugins/Architecture/PPC64/ArchitecturePPC64.h" |
Jonas Devlieghere | be96042 | 2020-01-21 15:14:28 -0800 | [diff] [blame] | 45 | #include "Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h" |
Jason Molenda | 9ab5dc2 | 2016-07-21 08:30:55 +0000 | [diff] [blame] | 46 | #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h" |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 47 | #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 48 | #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 49 | #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h" |
Pavel Labath | 773c3b0 | 2016-03-29 15:00:26 +0000 | [diff] [blame] | 50 | #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 51 | #include "Plugins/Instruction/ARM/EmulateInstructionARM.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 52 | #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 53 | #include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h" |
| 54 | #include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h" |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 55 | #include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h" |
Jonas Devlieghere | 0feedeb | 2020-01-21 14:43:46 -0800 | [diff] [blame] | 56 | #include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h" |
Jonas Devlieghere | fc1e855 | 2020-01-21 15:01:36 -0800 | [diff] [blame] | 57 | #include "Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.h" |
Jonas Devlieghere | 7745990 | 2020-01-21 14:50:36 -0800 | [diff] [blame] | 58 | #include "Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h" |
Jonas Devlieghere | 623c3c4 | 2020-01-21 14:55:13 -0800 | [diff] [blame] | 59 | #include "Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 60 | #include "Plugins/JITLoader/GDB/JITLoaderGDB.h" |
Enrico Granata | 980c048 | 2015-09-01 18:22:39 +0000 | [diff] [blame] | 61 | #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" |
| 62 | #include "Plugins/Language/ObjC/ObjCLanguage.h" |
| 63 | #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 64 | #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" |
Jonas Devlieghere | 1d1ebb9 | 2020-01-21 22:20:48 -0800 | [diff] [blame] | 65 | #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" |
Colin Riley | 5ec532a | 2015-04-09 16:49:25 +0000 | [diff] [blame] | 66 | #include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 67 | #include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" |
Saleem Abdulrasool | c7c3cf6 | 2019-05-02 18:11:44 +0000 | [diff] [blame] | 68 | #include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" |
| 69 | #include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h" |
Pavel Labath | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 70 | #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h" |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 71 | #include "Plugins/ObjectFile/ELF/ObjectFileELF.h" |
| 72 | #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" |
| 73 | #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h" |
Paolo Severini | 4bafcec | 2020-01-15 15:29:24 -0800 | [diff] [blame] | 74 | #include "Plugins/ObjectFile/wasm/ObjectFileWasm.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 75 | #include "Plugins/OperatingSystem/Python/OperatingSystemPython.h" |
| 76 | #include "Plugins/Platform/Android/PlatformAndroid.h" |
| 77 | #include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 78 | #include "Plugins/Platform/Linux/PlatformLinux.h" |
| 79 | #include "Plugins/Platform/MacOSX/PlatformMacOSX.h" |
| 80 | #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h" |
| 81 | #include "Plugins/Platform/NetBSD/PlatformNetBSD.h" |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 82 | #include "Plugins/Platform/OpenBSD/PlatformOpenBSD.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 83 | #include "Plugins/Platform/Windows/PlatformWindows.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 84 | #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" |
| 85 | #include "Plugins/Process/elf-core/ProcessElfCore.h" |
| 86 | #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 87 | #include "Plugins/Process/mach-core/ProcessMachCore.h" |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 88 | #include "Plugins/Process/minidump/ProcessMinidump.h" |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 89 | #include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 90 | #include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 91 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" |
| 92 | #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 93 | #include "Plugins/SymbolFile/PDB/SymbolFilePDB.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 94 | #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" |
| 95 | #include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h" |
Paolo Severini | 9b3254d | 2020-01-16 08:36:45 -0800 | [diff] [blame] | 96 | #include "Plugins/SymbolVendor/wasm/SymbolVendorWasm.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 97 | #include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h" |
Alex Langford | 8be3021 | 2020-01-29 11:59:28 -0800 | [diff] [blame] | 98 | #include "Plugins/TypeSystem/Clang/TypeSystemClang.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 99 | #include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" |
Zachary Turner | 74e08ca | 2016-03-02 22:05:52 +0000 | [diff] [blame] | 100 | #include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h" |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 101 | |
| 102 | #if defined(__APPLE__) |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 103 | #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h" |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 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 | |
Saleem Abdulrasool | 5a36558 | 2019-05-03 23:19:27 +0000 | [diff] [blame] | 120 | #pragma clang diagnostic push |
| 121 | #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 122 | #include "llvm/ExecutionEngine/MCJIT.h" |
| 123 | #pragma clang diagnostic pop |
| 124 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 125 | #include <string> |
| 126 | |
| 127 | using namespace lldb_private; |
| 128 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 129 | SystemInitializerFull::SystemInitializerFull() {} |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 130 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 131 | SystemInitializerFull::~SystemInitializerFull() {} |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 132 | |
Pavel Labath | 8865ebb | 2019-09-26 09:47:32 +0000 | [diff] [blame] | 133 | #define LLDB_PROCESS_AArch64(op) \ |
| 134 | ABIMacOSX_arm64::op(); \ |
| 135 | ABISysV_arm64::op(); |
| 136 | #define LLDB_PROCESS_ARM(op) \ |
| 137 | ABIMacOSX_arm::op(); \ |
| 138 | ABISysV_arm::op(); |
Tatyana Krasnukha | 92e498d | 2019-10-17 15:18:03 +0000 | [diff] [blame] | 139 | #define LLDB_PROCESS_ARC(op) \ |
| 140 | ABISysV_arc::op(); |
Pavel Labath | 8865ebb | 2019-09-26 09:47:32 +0000 | [diff] [blame] | 141 | #define LLDB_PROCESS_Hexagon(op) ABISysV_hexagon::op(); |
| 142 | #define LLDB_PROCESS_Mips(op) \ |
| 143 | ABISysV_mips::op(); \ |
| 144 | ABISysV_mips64::op(); |
| 145 | #define LLDB_PROCESS_PowerPC(op) \ |
| 146 | ABISysV_ppc::op(); \ |
| 147 | ABISysV_ppc64::op(); |
| 148 | #define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op(); |
| 149 | #define LLDB_PROCESS_X86(op) \ |
| 150 | ABIMacOSX_i386::op(); \ |
| 151 | ABISysV_i386::op(); \ |
| 152 | ABISysV_x86_64::op(); \ |
| 153 | ABIWindows_x86_64::op(); |
| 154 | |
| 155 | #define LLDB_PROCESS_AMDGPU(op) |
Pavel Labath | e8f0613 | 2019-09-26 17:15:18 +0000 | [diff] [blame] | 156 | #define LLDB_PROCESS_AVR(op) |
Pavel Labath | 8865ebb | 2019-09-26 09:47:32 +0000 | [diff] [blame] | 157 | #define LLDB_PROCESS_BPF(op) |
| 158 | #define LLDB_PROCESS_Lanai(op) |
| 159 | #define LLDB_PROCESS_MSP430(op) |
| 160 | #define LLDB_PROCESS_NVPTX(op) |
| 161 | #define LLDB_PROCESS_RISCV(op) |
| 162 | #define LLDB_PROCESS_Sparc(op) |
| 163 | #define LLDB_PROCESS_WebAssembly(op) |
| 164 | #define LLDB_PROCESS_XCore(op) |
| 165 | |
Jonas Devlieghere | 936c624 | 2019-02-21 22:26:16 +0000 | [diff] [blame] | 166 | llvm::Error SystemInitializerFull::Initialize() { |
| 167 | if (auto e = SystemInitializerCommon::Initialize()) |
Jonas Devlieghere | 15eacd7 | 2018-12-03 17:28:29 +0000 | [diff] [blame] | 168 | return e; |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 169 | |
Pavel Labath | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 170 | breakpad::ObjectFileBreakpad::Initialize(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 171 | ObjectFileELF::Initialize(); |
| 172 | ObjectFileMachO::Initialize(); |
| 173 | ObjectFilePECOFF::Initialize(); |
Paolo Severini | 4bafcec | 2020-01-15 15:29:24 -0800 | [diff] [blame] | 174 | wasm::ObjectFileWasm::Initialize(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 175 | |
Saleem Abdulrasool | c7c3cf6 | 2019-05-02 18:11:44 +0000 | [diff] [blame] | 176 | ObjectContainerBSDArchive::Initialize(); |
| 177 | ObjectContainerUniversalMachO::Initialize(); |
| 178 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 179 | ScriptInterpreterNone::Initialize(); |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 180 | |
Jonas Devlieghere | 4e26cf2 | 2019-12-13 10:37:33 -0800 | [diff] [blame] | 181 | #if LLDB_ENABLE_PYTHON |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 182 | OperatingSystemPython::Initialize(); |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 183 | #endif |
Pavel Labath | a7760cb | 2016-03-16 08:48:56 +0000 | [diff] [blame] | 184 | |
Jonas Devlieghere | 4e26cf2 | 2019-12-13 10:37:33 -0800 | [diff] [blame] | 185 | #if LLDB_ENABLE_PYTHON |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 186 | ScriptInterpreterPython::Initialize(); |
Zachary Turner | 2c1f46d | 2015-07-30 20:28:07 +0000 | [diff] [blame] | 187 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 188 | |
Jonas Devlieghere | 67de8962 | 2019-12-07 15:49:35 -0800 | [diff] [blame] | 189 | #if LLDB_ENABLE_LUA |
| 190 | ScriptInterpreterLua::Initialize(); |
| 191 | #endif |
| 192 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 193 | platform_freebsd::PlatformFreeBSD::Initialize(); |
| 194 | platform_linux::PlatformLinux::Initialize(); |
| 195 | platform_netbsd::PlatformNetBSD::Initialize(); |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 196 | platform_openbsd::PlatformOpenBSD::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 197 | PlatformWindows::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 198 | platform_android::PlatformAndroid::Initialize(); |
| 199 | PlatformRemoteiOS::Initialize(); |
| 200 | PlatformMacOSX::Initialize(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 201 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 202 | // Initialize LLVM and Clang |
| 203 | llvm::InitializeAllTargets(); |
| 204 | llvm::InitializeAllAsmPrinters(); |
| 205 | llvm::InitializeAllTargetMCs(); |
| 206 | llvm::InitializeAllDisassemblers(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 207 | |
Raphael Isemann | 6e3b0cc | 2020-01-23 10:04:13 +0100 | [diff] [blame] | 208 | TypeSystemClang::Initialize(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 209 | |
Pavel Labath | 8865ebb | 2019-09-26 09:47:32 +0000 | [diff] [blame] | 210 | #define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Initialize) |
| 211 | #include "llvm/Config/Targets.def" |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 212 | |
| 213 | ArchitectureArm::Initialize(); |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 214 | ArchitectureMips::Initialize(); |
Jim Ingham | 0858126 | 2018-03-12 21:17:04 +0000 | [diff] [blame] | 215 | ArchitecturePPC64::Initialize(); |
Pavel Labath | 13e37d4 | 2017-10-25 21:05:31 +0000 | [diff] [blame] | 216 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 217 | DisassemblerLLVMC::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 218 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 219 | JITLoaderGDB::Initialize(); |
| 220 | ProcessElfCore::Initialize(); |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 221 | ProcessMachCore::Initialize(); |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 222 | minidump::ProcessMinidump::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 223 | MemoryHistoryASan::Initialize(); |
Jonas Devlieghere | 0feedeb | 2020-01-21 14:43:46 -0800 | [diff] [blame] | 224 | InstrumentationRuntimeASan::Initialize(); |
Jonas Devlieghere | 7745990 | 2020-01-21 14:50:36 -0800 | [diff] [blame] | 225 | InstrumentationRuntimeTSan::Initialize(); |
Jonas Devlieghere | 623c3c4 | 2020-01-21 14:55:13 -0800 | [diff] [blame] | 226 | InstrumentationRuntimeUBSan::Initialize(); |
Jonas Devlieghere | fc1e855 | 2020-01-21 15:01:36 -0800 | [diff] [blame] | 227 | InstrumentationRuntimeMainThreadChecker::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 228 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 229 | SymbolVendorELF::Initialize(); |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 230 | breakpad::SymbolFileBreakpad::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 231 | SymbolFileDWARF::Initialize(); |
| 232 | SymbolFilePDB::Initialize(); |
| 233 | SymbolFileSymtab::Initialize(); |
Paolo Severini | 9b3254d | 2020-01-16 08:36:45 -0800 | [diff] [blame] | 234 | wasm::SymbolVendorWasm::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 235 | UnwindAssemblyInstEmulation::Initialize(); |
| 236 | UnwindAssembly_x86::Initialize(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 237 | |
| 238 | EmulateInstructionARM::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 239 | EmulateInstructionARM64::Initialize(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 240 | EmulateInstructionMIPS::Initialize(); |
| 241 | EmulateInstructionMIPS64::Initialize(); |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 242 | EmulateInstructionPPC64::Initialize(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 243 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 244 | SymbolFileDWARFDebugMap::Initialize(); |
| 245 | ItaniumABILanguageRuntime::Initialize(); |
Jonas Devlieghere | 1d1ebb9 | 2020-01-21 22:20:48 -0800 | [diff] [blame] | 246 | AppleObjCRuntime::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 247 | SystemRuntimeMacOSX::Initialize(); |
| 248 | RenderScriptRuntime::Initialize(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 249 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 250 | CPlusPlusLanguage::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 251 | ObjCLanguage::Initialize(); |
| 252 | ObjCPlusPlusLanguage::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 253 | |
Hafiz Abid Qadeer | f6ee79c | 2016-12-15 15:00:41 +0000 | [diff] [blame] | 254 | #if defined(_WIN32) |
Adrian McCarthy | 4ad5def | 2016-11-23 16:26:37 +0000 | [diff] [blame] | 255 | ProcessWindows::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 256 | #endif |
| 257 | #if defined(__FreeBSD__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 258 | ProcessFreeBSD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 259 | #endif |
| 260 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 261 | SymbolVendorMacOSX::Initialize(); |
| 262 | ProcessKDP::Initialize(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 263 | DynamicLoaderDarwinKernel::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 264 | #endif |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 265 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 266 | // This plugin is valid on any host that talks to a Darwin remote. It |
| 267 | // shouldn't be limited to __APPLE__. |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 268 | StructuredDataDarwinLog::Initialize(); |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 269 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 270 | // Platform agnostic plugins |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 271 | platform_gdb_server::PlatformRemoteGDBServer::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 272 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 273 | process_gdb_remote::ProcessGDBRemote::Initialize(); |
| 274 | DynamicLoaderMacOSXDYLD::Initialize(); |
| 275 | DynamicLoaderMacOS::Initialize(); |
| 276 | DynamicLoaderPOSIXDYLD::Initialize(); |
| 277 | DynamicLoaderStatic::Initialize(); |
| 278 | DynamicLoaderWindowsDYLD::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 279 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 280 | // Scan for any system or user LLDB plug-ins |
| 281 | PluginManager::Initialize(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 282 | |
Adrian Prantl | 0509724 | 2018-04-30 16:49:04 +0000 | [diff] [blame] | 283 | // The process settings need to know about installed plug-ins, so the |
| 284 | // Settings must be initialized |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 285 | // AFTER PluginManager::Initialize is called. |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 286 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 287 | Debugger::SettingsInitialize(); |
Jonas Devlieghere | 15eacd7 | 2018-12-03 17:28:29 +0000 | [diff] [blame] | 288 | |
| 289 | return llvm::Error::success(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 290 | } |
| 291 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 292 | void SystemInitializerFull::Terminate() { |
Pavel Labath | f9d1647 | 2017-05-15 13:02:37 +0000 | [diff] [blame] | 293 | static Timer::Category func_cat(LLVM_PRETTY_FUNCTION); |
| 294 | Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 295 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 296 | Debugger::SettingsTerminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 297 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 298 | // Terminate and unload and loaded system or user LLDB plug-ins |
| 299 | PluginManager::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 300 | |
Raphael Isemann | 6e3b0cc | 2020-01-23 10:04:13 +0100 | [diff] [blame] | 301 | TypeSystemClang::Terminate(); |
Greg Clayton | 56939cb | 2015-09-17 22:23:34 +0000 | [diff] [blame] | 302 | |
Tatyana Krasnukha | 98fc548 | 2018-12-13 14:28:25 +0000 | [diff] [blame] | 303 | ArchitectureArm::Terminate(); |
| 304 | ArchitectureMips::Terminate(); |
| 305 | ArchitecturePPC64::Terminate(); |
| 306 | |
Pavel Labath | 8865ebb | 2019-09-26 09:47:32 +0000 | [diff] [blame] | 307 | #define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Terminate) |
| 308 | #include "llvm/Config/Targets.def" |
Pavel Labath | d0b44db | 2019-09-25 13:03:04 +0000 | [diff] [blame] | 309 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 310 | DisassemblerLLVMC::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 311 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 312 | JITLoaderGDB::Terminate(); |
| 313 | ProcessElfCore::Terminate(); |
Pavel Labath | 4c7763e | 2018-05-22 16:33:43 +0000 | [diff] [blame] | 314 | ProcessMachCore::Terminate(); |
Dimitar Vlahovski | 7b18dd4 | 2016-10-31 15:35:18 +0000 | [diff] [blame] | 315 | minidump::ProcessMinidump::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 316 | MemoryHistoryASan::Terminate(); |
Jonas Devlieghere | 0feedeb | 2020-01-21 14:43:46 -0800 | [diff] [blame] | 317 | InstrumentationRuntimeASan::Terminate(); |
Jonas Devlieghere | 7745990 | 2020-01-21 14:50:36 -0800 | [diff] [blame] | 318 | InstrumentationRuntimeTSan::Terminate(); |
Jonas Devlieghere | 623c3c4 | 2020-01-21 14:55:13 -0800 | [diff] [blame] | 319 | InstrumentationRuntimeUBSan::Terminate(); |
Jonas Devlieghere | fc1e855 | 2020-01-21 15:01:36 -0800 | [diff] [blame] | 320 | InstrumentationRuntimeMainThreadChecker::Terminate(); |
| 321 | |
Paolo Severini | 9b3254d | 2020-01-16 08:36:45 -0800 | [diff] [blame] | 322 | wasm::SymbolVendorWasm::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 323 | SymbolVendorELF::Terminate(); |
Pavel Labath | 1cf23e1 | 2019-01-11 11:17:51 +0000 | [diff] [blame] | 324 | breakpad::SymbolFileBreakpad::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 325 | SymbolFileDWARF::Terminate(); |
| 326 | SymbolFilePDB::Terminate(); |
| 327 | SymbolFileSymtab::Terminate(); |
| 328 | UnwindAssembly_x86::Terminate(); |
| 329 | UnwindAssemblyInstEmulation::Terminate(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 330 | |
| 331 | EmulateInstructionARM::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 332 | EmulateInstructionARM64::Terminate(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 333 | EmulateInstructionMIPS::Terminate(); |
| 334 | EmulateInstructionMIPS64::Terminate(); |
Pavel Labath | a535a7a | 2018-02-27 18:42:46 +0000 | [diff] [blame] | 335 | EmulateInstructionPPC64::Terminate(); |
Saleem Abdulrasool | e24d8c5 | 2019-05-06 19:38:24 +0000 | [diff] [blame] | 336 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 337 | SymbolFileDWARFDebugMap::Terminate(); |
| 338 | ItaniumABILanguageRuntime::Terminate(); |
Jonas Devlieghere | 1d1ebb9 | 2020-01-21 22:20:48 -0800 | [diff] [blame] | 339 | AppleObjCRuntime::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 340 | SystemRuntimeMacOSX::Terminate(); |
| 341 | RenderScriptRuntime::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 342 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 343 | CPlusPlusLanguage::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 344 | ObjCLanguage::Terminate(); |
| 345 | ObjCPlusPlusLanguage::Terminate(); |
Ed Maste | 81b4c5f | 2016-01-04 01:43:47 +0000 | [diff] [blame] | 346 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 347 | #if defined(__APPLE__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 348 | DynamicLoaderDarwinKernel::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 349 | ProcessKDP::Terminate(); |
| 350 | SymbolVendorMacOSX::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 351 | #endif |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 352 | |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 353 | #if defined(__FreeBSD__) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 354 | ProcessFreeBSD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 355 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 356 | Debugger::SettingsTerminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 357 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 358 | platform_gdb_server::PlatformRemoteGDBServer::Terminate(); |
| 359 | process_gdb_remote::ProcessGDBRemote::Terminate(); |
| 360 | StructuredDataDarwinLog::Terminate(); |
Todd Fiala | 7593001 | 2016-08-19 04:21:48 +0000 | [diff] [blame] | 361 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 362 | DynamicLoaderMacOSXDYLD::Terminate(); |
| 363 | DynamicLoaderMacOS::Terminate(); |
| 364 | DynamicLoaderPOSIXDYLD::Terminate(); |
| 365 | DynamicLoaderStatic::Terminate(); |
| 366 | DynamicLoaderWindowsDYLD::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 367 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 368 | platform_freebsd::PlatformFreeBSD::Terminate(); |
| 369 | platform_linux::PlatformLinux::Terminate(); |
| 370 | platform_netbsd::PlatformNetBSD::Terminate(); |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 371 | platform_openbsd::PlatformOpenBSD::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 372 | PlatformWindows::Terminate(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 373 | platform_android::PlatformAndroid::Terminate(); |
| 374 | PlatformMacOSX::Terminate(); |
| 375 | PlatformRemoteiOS::Terminate(); |
Pavel Labath | f176353 | 2016-06-29 13:58:27 +0000 | [diff] [blame] | 376 | |
Pavel Labath | 1f6b247 | 2018-12-10 17:16:38 +0000 | [diff] [blame] | 377 | breakpad::ObjectFileBreakpad::Terminate(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 378 | ObjectFileELF::Terminate(); |
| 379 | ObjectFileMachO::Terminate(); |
| 380 | ObjectFilePECOFF::Terminate(); |
Paolo Severini | 4bafcec | 2020-01-15 15:29:24 -0800 | [diff] [blame] | 381 | wasm::ObjectFileWasm::Terminate(); |
Pavel Labath | fa3fa5b | 2018-05-24 12:44:18 +0000 | [diff] [blame] | 382 | |
Saleem Abdulrasool | c7c3cf6 | 2019-05-02 18:11:44 +0000 | [diff] [blame] | 383 | ObjectContainerBSDArchive::Terminate(); |
| 384 | ObjectContainerUniversalMachO::Terminate(); |
| 385 | |
Raphael Isemann | f2d41ad | 2020-01-17 12:31:15 +0100 | [diff] [blame] | 386 | #if LLDB_ENABLE_PYTHON |
| 387 | OperatingSystemPython::Terminate(); |
| 388 | #endif |
| 389 | |
| 390 | #if LLDB_ENABLE_PYTHON |
| 391 | ScriptInterpreterPython::Terminate(); |
| 392 | #endif |
| 393 | |
| 394 | #if LLDB_ENABLE_LUA |
| 395 | ScriptInterpreterLua::Terminate(); |
| 396 | #endif |
| 397 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 398 | // Now shutdown the common parts, in reverse order. |
| 399 | SystemInitializerCommon::Terminate(); |
Zachary Turner | e6e2bb3 | 2015-03-31 21:03:22 +0000 | [diff] [blame] | 400 | } |