diff --git a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h --- a/lldb/include/lldb/Core/PluginManager.h +++ b/lldb/include/lldb/Core/PluginManager.h @@ -22,6 +22,20 @@ #include #include +#define LLDB_PLUGIN(PluginName) \ + namespace lldb_private { \ + void lldb_initialize_##PluginName() { PluginName::Initialize(); } \ + void lldb_terminate_##PluginName() { PluginName::Terminate(); } \ + } + +// FIXME: Generate me with CMake +#define LLDB_PLUGIN_INITIALIZE(PluginName) \ + extern void lldb_initialize_##PluginName(); \ + lldb_initialize_##PluginName() +#define LLDB_PLUGIN_TERMINATE(PluginName) \ + extern void lldb_terminate_##PluginName(); \ + lldb_terminate_##PluginName() + namespace lldb_private { class CommandInterpreter; class ConstString; @@ -42,15 +56,13 @@ static ABICreateInstance GetABICreateCallbackAtIndex(uint32_t idx); - static ABICreateInstance - GetABICreateCallbackForPluginName(ConstString name); + static ABICreateInstance GetABICreateCallbackForPluginName(ConstString name); // Architecture using ArchitectureCreateInstance = std::unique_ptr (*)(const ArchSpec &); - static void RegisterPlugin(ConstString name, - llvm::StringRef description, + static void RegisterPlugin(ConstString name, llvm::StringRef description, ArchitectureCreateInstance create_callback); static void UnregisterPlugin(ArchitectureCreateInstance create_callback); diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp --- a/lldb/source/API/SystemInitializerFull.cpp +++ b/lldb/source/API/SystemInitializerFull.cpp @@ -8,113 +8,13 @@ #include "SystemInitializerFull.h" #include "lldb/API/SBCommandInterpreter.h" -#include "lldb/Host/Config.h" - -#if LLDB_ENABLE_PYTHON -#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" -#endif - -#if LLDB_ENABLE_LUA -#include "Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h" -#endif - #include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Host/Config.h" #include "lldb/Host/Host.h" #include "lldb/Initialization/SystemInitializerCommon.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Utility/Timer.h" - -#include "Plugins/ABI/AArch64/ABIMacOSX_arm64.h" -#include "Plugins/ABI/AArch64/ABISysV_arm64.h" -#include "Plugins/ABI/ARC/ABISysV_arc.h" -#include "Plugins/ABI/ARM/ABIMacOSX_arm.h" -#include "Plugins/ABI/ARM/ABISysV_arm.h" -#include "Plugins/ABI/Hexagon/ABISysV_hexagon.h" -#include "Plugins/ABI/Mips/ABISysV_mips.h" -#include "Plugins/ABI/Mips/ABISysV_mips64.h" -#include "Plugins/ABI/PowerPC/ABISysV_ppc.h" -#include "Plugins/ABI/PowerPC/ABISysV_ppc64.h" -#include "Plugins/ABI/SystemZ/ABISysV_s390x.h" -#include "Plugins/ABI/X86/ABIMacOSX_i386.h" -#include "Plugins/ABI/X86/ABISysV_i386.h" -#include "Plugins/ABI/X86/ABISysV_x86_64.h" -#include "Plugins/ABI/X86/ABIWindows_x86_64.h" -#include "Plugins/Architecture/Arm/ArchitectureArm.h" -#include "Plugins/Architecture/Mips/ArchitectureMips.h" -#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h" -#include "Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h" -#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h" -#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" -#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" -#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h" -#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" -#include "Plugins/Instruction/ARM/EmulateInstructionARM.h" -#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" -#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h" -#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h" -#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h" -#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h" -#include "Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.h" -#include "Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h" -#include "Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h" -#include "Plugins/JITLoader/GDB/JITLoaderGDB.h" -#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" -#include "Plugins/Language/ObjC/ObjCLanguage.h" -#include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" -#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" -#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" -#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" -#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" -#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h" -#include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h" -#include "Plugins/ObjectFile/ELF/ObjectFileELF.h" -#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" -#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h" -#include "Plugins/ObjectFile/wasm/ObjectFileWasm.h" -#include "Plugins/OperatingSystem/Python/OperatingSystemPython.h" -#include "Plugins/Platform/Android/PlatformAndroid.h" -#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h" -#include "Plugins/Platform/Linux/PlatformLinux.h" -#include "Plugins/Platform/MacOSX/PlatformMacOSX.h" -#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h" -#include "Plugins/Platform/NetBSD/PlatformNetBSD.h" -#include "Plugins/Platform/OpenBSD/PlatformOpenBSD.h" -#include "Plugins/Platform/Windows/PlatformWindows.h" -#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" -#include "Plugins/Process/elf-core/ProcessElfCore.h" -#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" -#include "Plugins/Process/mach-core/ProcessMachCore.h" -#include "Plugins/Process/minidump/ProcessMinidump.h" -#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" -#include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h" -#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" -#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" -#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h" -#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" -#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h" -#include "Plugins/SymbolVendor/wasm/SymbolVendorWasm.h" -#include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h" -#include "Plugins/TypeSystem/Clang/TypeSystemClang.h" -#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" -#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h" - -#if defined(__APPLE__) -#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h" -#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h" -#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h" -#endif -#include "Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h" - -#if defined(__FreeBSD__) -#include "Plugins/Process/FreeBSD/ProcessFreeBSD.h" -#endif - -#if defined(_WIN32) -#include "Plugins/Process/Windows/Common/ProcessWindows.h" -#include "lldb/Host/windows/windows.h" -#endif - #include "llvm/Support/TargetSelect.h" #pragma clang diagnostic push @@ -131,26 +31,25 @@ SystemInitializerFull::~SystemInitializerFull() {} #define LLDB_PROCESS_AArch64(op) \ - ABIMacOSX_arm64::op(); \ - ABISysV_arm64::op(); + op(ABIMacOSX_arm64); \ + op(ABISysV_arm64); #define LLDB_PROCESS_ARM(op) \ - ABIMacOSX_arm::op(); \ - ABISysV_arm::op(); -#define LLDB_PROCESS_ARC(op) \ - ABISysV_arc::op(); -#define LLDB_PROCESS_Hexagon(op) ABISysV_hexagon::op(); + op(ABIMacOSX_arm); \ + op(ABISysV_arm); +#define LLDB_PROCESS_ARC(op) op(ABISysV_arc); +#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon); #define LLDB_PROCESS_Mips(op) \ - ABISysV_mips::op(); \ - ABISysV_mips64::op(); + op(ABISysV_mips); \ + op(ABISysV_mips64); #define LLDB_PROCESS_PowerPC(op) \ - ABISysV_ppc::op(); \ - ABISysV_ppc64::op(); -#define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op(); + op(ABISysV_ppc); \ + op(ABISysV_ppc64); +#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x); #define LLDB_PROCESS_X86(op) \ - ABIMacOSX_i386::op(); \ - ABISysV_i386::op(); \ - ABISysV_x86_64::op(); \ - ABIWindows_x86_64::op(); + op(ABIMacOSX_i386); \ + op(ABISysV_i386); \ + op(ABISysV_x86_64); \ + op(ABIWindows_x86_64); #define LLDB_PROCESS_AMDGPU(op) #define LLDB_PROCESS_AVR(op) @@ -167,37 +66,36 @@ if (auto e = SystemInitializerCommon::Initialize()) return e; - breakpad::ObjectFileBreakpad::Initialize(); - ObjectFileELF::Initialize(); - ObjectFileMachO::Initialize(); - ObjectFilePECOFF::Initialize(); - wasm::ObjectFileWasm::Initialize(); + LLDB_PLUGIN_INITIALIZE(ObjectFileBreakpad); + LLDB_PLUGIN_INITIALIZE(ObjectFileELF); + LLDB_PLUGIN_INITIALIZE(ObjectFileMachO); + LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF); + LLDB_PLUGIN_INITIALIZE(ObjectFileWasm); - ObjectContainerBSDArchive::Initialize(); - ObjectContainerUniversalMachO::Initialize(); + LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive); + LLDB_PLUGIN_INITIALIZE(ObjectContainerUniversalMachO); - ScriptInterpreterNone::Initialize(); + LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone); #if LLDB_ENABLE_PYTHON - OperatingSystemPython::Initialize(); + LLDB_PLUGIN_INITIALIZE(OperatingSystemPython); #endif #if LLDB_ENABLE_PYTHON - ScriptInterpreterPython::Initialize(); + LLDB_PLUGIN_INITIALIZE(ScriptInterpreterPython); #endif #if LLDB_ENABLE_LUA - ScriptInterpreterLua::Initialize(); + LLDB_PLUGIN_INITIALIZE(ScriptInterpreterLua); #endif - - platform_freebsd::PlatformFreeBSD::Initialize(); - platform_linux::PlatformLinux::Initialize(); - platform_netbsd::PlatformNetBSD::Initialize(); - platform_openbsd::PlatformOpenBSD::Initialize(); - PlatformWindows::Initialize(); - platform_android::PlatformAndroid::Initialize(); - PlatformRemoteiOS::Initialize(); - PlatformMacOSX::Initialize(); + LLDB_PLUGIN_INITIALIZE(PlatformFreeBSD); + LLDB_PLUGIN_INITIALIZE(PlatformLinux); + LLDB_PLUGIN_INITIALIZE(PlatformNetBSD); + LLDB_PLUGIN_INITIALIZE(PlatformOpenBSD); + LLDB_PLUGIN_INITIALIZE(PlatformWindows); + LLDB_PLUGIN_INITIALIZE(PlatformAndroid); + LLDB_PLUGIN_INITIALIZE(PlatformRemoteiOS); + LLDB_PLUGIN_INITIALIZE(PlatformMacOSX); // Initialize LLVM and Clang llvm::InitializeAllTargets(); @@ -205,77 +103,77 @@ llvm::InitializeAllTargetMCs(); llvm::InitializeAllDisassemblers(); - TypeSystemClang::Initialize(); + LLDB_PLUGIN_INITIALIZE(TypeSystemClang); -#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Initialize) +#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_INITIALIZE) #include "llvm/Config/Targets.def" - ArchitectureArm::Initialize(); - ArchitectureMips::Initialize(); - ArchitecturePPC64::Initialize(); - - DisassemblerLLVMC::Initialize(); - - JITLoaderGDB::Initialize(); - ProcessElfCore::Initialize(); - ProcessMachCore::Initialize(); - minidump::ProcessMinidump::Initialize(); - MemoryHistoryASan::Initialize(); - InstrumentationRuntimeASan::Initialize(); - InstrumentationRuntimeTSan::Initialize(); - InstrumentationRuntimeUBSan::Initialize(); - InstrumentationRuntimeMainThreadChecker::Initialize(); - - SymbolVendorELF::Initialize(); - breakpad::SymbolFileBreakpad::Initialize(); - SymbolFileDWARF::Initialize(); - SymbolFilePDB::Initialize(); - SymbolFileSymtab::Initialize(); - wasm::SymbolVendorWasm::Initialize(); - UnwindAssemblyInstEmulation::Initialize(); - UnwindAssembly_x86::Initialize(); - - EmulateInstructionARM::Initialize(); - EmulateInstructionARM64::Initialize(); - EmulateInstructionMIPS::Initialize(); - EmulateInstructionMIPS64::Initialize(); - EmulateInstructionPPC64::Initialize(); - - SymbolFileDWARFDebugMap::Initialize(); - ItaniumABILanguageRuntime::Initialize(); - AppleObjCRuntime::Initialize(); - SystemRuntimeMacOSX::Initialize(); - RenderScriptRuntime::Initialize(); - - CPlusPlusLanguage::Initialize(); - ObjCLanguage::Initialize(); - ObjCPlusPlusLanguage::Initialize(); + LLDB_PLUGIN_INITIALIZE(ArchitectureArm); + LLDB_PLUGIN_INITIALIZE(ArchitectureMips); + LLDB_PLUGIN_INITIALIZE(ArchitecturePPC64); + + LLDB_PLUGIN_INITIALIZE(DisassemblerLLVMC); + + LLDB_PLUGIN_INITIALIZE(JITLoaderGDB); + LLDB_PLUGIN_INITIALIZE(ProcessElfCore); + LLDB_PLUGIN_INITIALIZE(ProcessMachCore); + LLDB_PLUGIN_INITIALIZE(ProcessMinidump); + LLDB_PLUGIN_INITIALIZE(MemoryHistoryASan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeASan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeTSan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeUBSan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeMainThreadChecker); + + LLDB_PLUGIN_INITIALIZE(SymbolVendorELF); + LLDB_PLUGIN_INITIALIZE(SymbolFileBreakpad); + LLDB_PLUGIN_INITIALIZE(SymbolFileDWARF); + LLDB_PLUGIN_INITIALIZE(SymbolFilePDB); + LLDB_PLUGIN_INITIALIZE(SymbolFileSymtab); + LLDB_PLUGIN_INITIALIZE(SymbolVendorWasm); + LLDB_PLUGIN_INITIALIZE(UnwindAssemblyInstEmulation); + LLDB_PLUGIN_INITIALIZE(UnwindAssembly_x86); + + LLDB_PLUGIN_INITIALIZE(EmulateInstructionARM); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionARM64); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionMIPS); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionMIPS64); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionPPC64); + + LLDB_PLUGIN_INITIALIZE(SymbolFileDWARFDebugMap); + LLDB_PLUGIN_INITIALIZE(ItaniumABILanguageRuntime); + LLDB_PLUGIN_INITIALIZE(AppleObjCRuntime); + LLDB_PLUGIN_INITIALIZE(SystemRuntimeMacOSX); + LLDB_PLUGIN_INITIALIZE(RenderScriptRuntime); + + LLDB_PLUGIN_INITIALIZE(CPlusPlusLanguage); + LLDB_PLUGIN_INITIALIZE(ObjCLanguage); + LLDB_PLUGIN_INITIALIZE(ObjCPlusPlusLanguage); #if defined(_WIN32) - ProcessWindows::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessWindows); #endif #if defined(__FreeBSD__) - ProcessFreeBSD::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD); #endif #if defined(__APPLE__) - SymbolVendorMacOSX::Initialize(); - ProcessKDP::Initialize(); - DynamicLoaderDarwinKernel::Initialize(); + LLDB_PLUGIN_INITIALIZE(SymbolVendorMacOSX); + LLDB_PLUGIN_INITIALIZE(ProcessKDP); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderDarwinKernel); #endif // This plugin is valid on any host that talks to a Darwin remote. It // shouldn't be limited to __APPLE__. - StructuredDataDarwinLog::Initialize(); + LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog); // Platform agnostic plugins - platform_gdb_server::PlatformRemoteGDBServer::Initialize(); + LLDB_PLUGIN_INITIALIZE(PlatformRemoteGDBServer); - process_gdb_remote::ProcessGDBRemote::Initialize(); - DynamicLoaderMacOSXDYLD::Initialize(); - DynamicLoaderMacOS::Initialize(); - DynamicLoaderPOSIXDYLD::Initialize(); - DynamicLoaderStatic::Initialize(); - DynamicLoaderWindowsDYLD::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOS); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderPOSIXDYLD); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderWindowsDYLD); // Scan for any system or user LLDB plug-ins PluginManager::Initialize(); @@ -298,103 +196,106 @@ // Terminate and unload and loaded system or user LLDB plug-ins PluginManager::Terminate(); - TypeSystemClang::Terminate(); + LLDB_PLUGIN_TERMINATE(TypeSystemClang); - ArchitectureArm::Terminate(); - ArchitectureMips::Terminate(); - ArchitecturePPC64::Terminate(); + LLDB_PLUGIN_TERMINATE(ArchitectureArm); + LLDB_PLUGIN_TERMINATE(ArchitectureMips); + LLDB_PLUGIN_TERMINATE(ArchitecturePPC64); -#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Terminate) +#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_TERMINATE) #include "llvm/Config/Targets.def" - DisassemblerLLVMC::Terminate(); - - JITLoaderGDB::Terminate(); - ProcessElfCore::Terminate(); - ProcessMachCore::Terminate(); - minidump::ProcessMinidump::Terminate(); - MemoryHistoryASan::Terminate(); - InstrumentationRuntimeASan::Terminate(); - InstrumentationRuntimeTSan::Terminate(); - InstrumentationRuntimeUBSan::Terminate(); - InstrumentationRuntimeMainThreadChecker::Terminate(); - - wasm::SymbolVendorWasm::Terminate(); - SymbolVendorELF::Terminate(); - breakpad::SymbolFileBreakpad::Terminate(); - SymbolFileDWARF::Terminate(); - SymbolFilePDB::Terminate(); - SymbolFileSymtab::Terminate(); - UnwindAssembly_x86::Terminate(); - UnwindAssemblyInstEmulation::Terminate(); - - EmulateInstructionARM::Terminate(); - EmulateInstructionARM64::Terminate(); - EmulateInstructionMIPS::Terminate(); - EmulateInstructionMIPS64::Terminate(); - EmulateInstructionPPC64::Terminate(); - - SymbolFileDWARFDebugMap::Terminate(); - ItaniumABILanguageRuntime::Terminate(); - AppleObjCRuntime::Terminate(); - SystemRuntimeMacOSX::Terminate(); - RenderScriptRuntime::Terminate(); - - CPlusPlusLanguage::Terminate(); - ObjCLanguage::Terminate(); - ObjCPlusPlusLanguage::Terminate(); + LLDB_PLUGIN_TERMINATE(DisassemblerLLVMC); + + LLDB_PLUGIN_TERMINATE(JITLoaderGDB); + LLDB_PLUGIN_TERMINATE(ProcessElfCore); + LLDB_PLUGIN_TERMINATE(ProcessMachCore); + LLDB_PLUGIN_TERMINATE(ProcessMinidump); + LLDB_PLUGIN_TERMINATE(MemoryHistoryASan); + + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeASan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeTSan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeUBSan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeMainThreadChecker); + + LLDB_PLUGIN_TERMINATE(SymbolVendorWasm); + LLDB_PLUGIN_TERMINATE(SymbolVendorELF); + LLDB_PLUGIN_TERMINATE(SymbolFileBreakpad); + LLDB_PLUGIN_TERMINATE(SymbolFileDWARF); + LLDB_PLUGIN_TERMINATE(SymbolFilePDB); + LLDB_PLUGIN_TERMINATE(SymbolFileSymtab); + LLDB_PLUGIN_TERMINATE(UnwindAssembly_x86); + LLDB_PLUGIN_TERMINATE(UnwindAssemblyInstEmulation); + + LLDB_PLUGIN_TERMINATE(EmulateInstructionARM); + LLDB_PLUGIN_TERMINATE(EmulateInstructionARM64); + LLDB_PLUGIN_TERMINATE(EmulateInstructionMIPS); + LLDB_PLUGIN_TERMINATE(EmulateInstructionMIPS64); + LLDB_PLUGIN_TERMINATE(EmulateInstructionPPC64); + + LLDB_PLUGIN_TERMINATE(SymbolFileDWARFDebugMap); + LLDB_PLUGIN_TERMINATE(ItaniumABILanguageRuntime); + LLDB_PLUGIN_TERMINATE(AppleObjCRuntime); + LLDB_PLUGIN_TERMINATE(SystemRuntimeMacOSX); + LLDB_PLUGIN_TERMINATE(RenderScriptRuntime); + + LLDB_PLUGIN_TERMINATE(CPlusPlusLanguage); + LLDB_PLUGIN_TERMINATE(ObjCLanguage); + LLDB_PLUGIN_TERMINATE(ObjCPlusPlusLanguage); #if defined(__APPLE__) - DynamicLoaderDarwinKernel::Terminate(); - ProcessKDP::Terminate(); - SymbolVendorMacOSX::Terminate(); + LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel); + LLDB_PLUGIN_TERMINATE(ProcessKDP); + LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX); #endif #if defined(__FreeBSD__) - ProcessFreeBSD::Terminate(); + LLDB_PLUGIN_TERMINATE(ProcessFreeBSD); #endif Debugger::SettingsTerminate(); - platform_gdb_server::PlatformRemoteGDBServer::Terminate(); - process_gdb_remote::ProcessGDBRemote::Terminate(); - StructuredDataDarwinLog::Terminate(); - - DynamicLoaderMacOSXDYLD::Terminate(); - DynamicLoaderMacOS::Terminate(); - DynamicLoaderPOSIXDYLD::Terminate(); - DynamicLoaderStatic::Terminate(); - DynamicLoaderWindowsDYLD::Terminate(); - - platform_freebsd::PlatformFreeBSD::Terminate(); - platform_linux::PlatformLinux::Terminate(); - platform_netbsd::PlatformNetBSD::Terminate(); - platform_openbsd::PlatformOpenBSD::Terminate(); - PlatformWindows::Terminate(); - platform_android::PlatformAndroid::Terminate(); - PlatformMacOSX::Terminate(); - PlatformRemoteiOS::Terminate(); - - breakpad::ObjectFileBreakpad::Terminate(); - ObjectFileELF::Terminate(); - ObjectFileMachO::Terminate(); - ObjectFilePECOFF::Terminate(); - wasm::ObjectFileWasm::Terminate(); - - ObjectContainerBSDArchive::Terminate(); - ObjectContainerUniversalMachO::Terminate(); + LLDB_PLUGIN_TERMINATE(PlatformRemoteGDBServer); + LLDB_PLUGIN_TERMINATE(ProcessGDBRemote); + LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog); + + LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD); + LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOS); + LLDB_PLUGIN_TERMINATE(DynamicLoaderPOSIXDYLD); + LLDB_PLUGIN_TERMINATE(DynamicLoaderStatic); + LLDB_PLUGIN_TERMINATE(DynamicLoaderWindowsDYLD); + + LLDB_PLUGIN_TERMINATE(PlatformFreeBSD); + LLDB_PLUGIN_TERMINATE(PlatformLinux); + LLDB_PLUGIN_TERMINATE(PlatformNetBSD); + LLDB_PLUGIN_TERMINATE(PlatformOpenBSD); + LLDB_PLUGIN_TERMINATE(PlatformWindows); + LLDB_PLUGIN_TERMINATE(PlatformAndroid); + LLDB_PLUGIN_TERMINATE(PlatformRemoteiOS); + LLDB_PLUGIN_TERMINATE(PlatformMacOSX); + + LLDB_PLUGIN_TERMINATE(ObjectFileBreakpad); + LLDB_PLUGIN_TERMINATE(ObjectFileELF); + LLDB_PLUGIN_TERMINATE(ObjectFileMachO); + LLDB_PLUGIN_TERMINATE(ObjectFilePECOFF); + LLDB_PLUGIN_TERMINATE(ObjectFileWasm); + + LLDB_PLUGIN_TERMINATE(ObjectContainerBSDArchive); + LLDB_PLUGIN_TERMINATE(ObjectContainerUniversalMachO); #if LLDB_ENABLE_PYTHON - OperatingSystemPython::Terminate(); + LLDB_PLUGIN_TERMINATE(OperatingSystemPython); #endif #if LLDB_ENABLE_PYTHON - ScriptInterpreterPython::Terminate(); + LLDB_PLUGIN_TERMINATE(ScriptInterpreterPython); #endif #if LLDB_ENABLE_LUA - ScriptInterpreterLua::Terminate(); + LLDB_PLUGIN_TERMINATE(ScriptInterpreterLua); #endif + LLDB_PLUGIN_TERMINATE(ScriptInterpreterNone); + // Now shutdown the common parts, in reverse order. SystemInitializerCommon::Terminate(); } diff --git a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp --- a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp @@ -33,6 +33,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABIMacOSX_arm64); + static const char *pluginDesc = "Mac OS X ABI for arm64 targets"; static RegisterInfo g_register_infos[] = { diff --git a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp --- a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp +++ b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp @@ -33,6 +33,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_arm64); + static RegisterInfo g_register_infos[] = { // NAME ALT SZ OFF ENCODING FORMAT // EH_FRAME DWARF GENERIC diff --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp --- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp +++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp @@ -55,6 +55,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_arc); + namespace { namespace dwarf { enum regnums { diff --git a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp --- a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp @@ -34,6 +34,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABIMacOSX_arm); + static RegisterInfo g_register_infos[] = { // NAME ALT SZ OFF ENCODING FORMAT EH_FRAME // DWARF GENERIC PROCESS PLUGIN diff --git a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp --- a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp +++ b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp @@ -34,6 +34,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_arm); + static RegisterInfo g_register_infos[] = { // NAME ALT SZ OFF ENCODING FORMAT EH_FRAME // DWARF GENERIC PROCESS PLUGIN diff --git a/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp --- a/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_hexagon); + static RegisterInfo g_register_infos[] = { // hexagon-core.xml {"r00", diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp --- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp +++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_mips); + enum dwarf_regnums { dwarf_r0 = 0, dwarf_r1, diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp --- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp +++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_mips64); + enum dwarf_regnums { dwarf_r0 = 0, dwarf_r1, diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp --- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp +++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_ppc); + enum dwarf_regnums { dwarf_r0 = 0, dwarf_r1, diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp --- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp +++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp @@ -47,6 +47,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_ppc64); + const lldb_private::RegisterInfo * ABISysV_ppc64::GetRegisterInfoArray(uint32_t &count) { if (GetByteOrder() == lldb::eByteOrderLittle) { diff --git a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp --- a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp +++ b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_s390x); + enum dwarf_regnums { // General Purpose Registers dwarf_r0_s390x = 0, diff --git a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp --- a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp @@ -29,6 +29,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABIMacOSX_i386); + enum { ehframe_eax = 0, ehframe_ecx, diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp --- a/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp +++ b/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp @@ -31,6 +31,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_i386); + // This source file uses the following document as a reference: //==================================================================== // System V Application Binary Interface diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp --- a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp @@ -35,6 +35,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABISysV_x86_64); + enum dwarf_regnums { dwarf_rax = 0, dwarf_rdx, diff --git a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp --- a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp +++ b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp @@ -33,6 +33,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ABIWindows_x86_64); + enum dwarf_regnums { dwarf_rax = 0, dwarf_rdx, diff --git a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp --- a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp +++ b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp @@ -17,6 +17,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN(ArchitectureArm); + ConstString ArchitectureArm::GetPluginNameStatic() { return ConstString("arm"); } diff --git a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp --- a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp +++ b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp @@ -21,6 +21,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN(ArchitectureMips); + ConstString ArchitectureMips::GetPluginNameStatic() { return ConstString("mips"); } diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp --- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp +++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp @@ -20,6 +20,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN(ArchitecturePPC64); + ConstString ArchitecturePPC64::GetPluginNameStatic() { return ConstString("ppc64"); } diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp --- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp @@ -43,6 +43,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DisassemblerLLVMC); + class DisassemblerLLVMC::MCDisasmInstance { public: static std::unique_ptr diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -44,6 +44,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderDarwinKernel); + // Progressively greater amounts of scanning we will allow For some targets // very early in startup, we can't do any random reads of memory or we can // crash the device so a setting is needed that can completely disable the diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp @@ -28,6 +28,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderMacOS); + // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -48,6 +48,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderMacOSXDYLD); + // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -29,6 +29,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderPOSIXDYLD); + void DynamicLoaderPOSIXDYLD::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance); diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -17,6 +17,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderStatic); + // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. diff --git a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp --- a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp @@ -23,6 +23,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(DynamicLoaderWindowsDYLD); + DynamicLoaderWindowsDYLD::DynamicLoaderWindowsDYLD(Process *process) : DynamicLoader(process) {} diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -30,6 +30,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(EmulateInstructionARM); + // Convenient macro definitions. #define APSR_C Bit32(m_opcode_cpsr, CPSR_C_POS) #define APSR_V Bit32(m_opcode_cpsr, CPSR_V_POS) diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -47,6 +47,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(EmulateInstructionARM64); + static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) { if (reg_num >= llvm::array_lengthof(g_register_infos_arm64_le)) return false; diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp --- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -40,6 +40,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(EmulateInstructionMIPS); + #define UInt(x) ((uint64_t)x) #define integer int64_t diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -40,6 +40,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(EmulateInstructionMIPS64); + #define UInt(x) ((uint64_t)x) #define integer int64_t diff --git a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp --- a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp +++ b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp @@ -25,6 +25,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(EmulateInstructionPPC64); + EmulateInstructionPPC64::EmulateInstructionPPC64(const ArchSpec &arch) : EmulateInstruction(arch) {} diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp --- a/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp @@ -30,6 +30,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(InstrumentationRuntimeASan); + lldb::InstrumentationRuntimeSP InstrumentationRuntimeASan::CreateInstance(const lldb::ProcessSP &process_sp) { return InstrumentationRuntimeSP(new InstrumentationRuntimeASan(process_sp)); diff --git a/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp b/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp --- a/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp @@ -29,6 +29,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(InstrumentationRuntimeMainThreadChecker); + InstrumentationRuntimeMainThreadChecker:: ~InstrumentationRuntimeMainThreadChecker() { Deactivate(); diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp --- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp @@ -35,6 +35,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(InstrumentationRuntimeTSan); + lldb::InstrumentationRuntimeSP InstrumentationRuntimeTSan::CreateInstance(const lldb::ProcessSP &process_sp) { return InstrumentationRuntimeSP(new InstrumentationRuntimeTSan(process_sp)); diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp --- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp @@ -36,6 +36,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(InstrumentationRuntimeUBSan); + InstrumentationRuntimeUBSan::~InstrumentationRuntimeUBSan() { Deactivate(); } lldb::InstrumentationRuntimeSP diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -32,6 +32,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(JITLoaderGDB); + // Debug Interface Structures enum jit_actions_t { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN }; diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -43,6 +43,8 @@ using namespace lldb_private; using namespace lldb_private::formatters; +LLDB_PLUGIN(CPlusPlusLanguage); + void CPlusPlusLanguage::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), "C++ Language", CreateInstance); diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp --- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp @@ -37,6 +37,8 @@ using namespace lldb_private; using namespace lldb_private::formatters; +LLDB_PLUGIN(ObjCLanguage); + void ObjCLanguage::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), "Objective-C Language", CreateInstance); diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp --- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp @@ -14,6 +14,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ObjCPlusPlusLanguage); + bool ObjCPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const { const auto suffixes = {".h", ".mm"}; for (auto suffix : suffixes) { diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -40,6 +40,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ItaniumABILanguageRuntime); + static const char *vtable_demangled_prefix = "vtable for "; char ItaniumABILanguageRuntime::ID = 0; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -44,6 +44,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(AppleObjCRuntime); + char AppleObjCRuntime::ID = 0; AppleObjCRuntime::~AppleObjCRuntime() {} diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -46,6 +46,8 @@ using namespace lldb_private; using namespace lldb_renderscript; +LLDB_PLUGIN(RenderScriptRuntime); + #define FMT_COORD "(%" PRIu32 ", %" PRIu32 ", %" PRIu32 ")" char RenderScriptRuntime::ID = 0; diff --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp --- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp +++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp @@ -28,6 +28,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(MemoryHistoryASan); + MemoryHistorySP MemoryHistoryASan::CreateInstance(const ProcessSP &process_sp) { if (!process_sp.get()) return nullptr; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -40,6 +40,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ObjectContainerBSDArchive); + ObjectContainerBSDArchive::Object::Object() : ar_name(), modification_time(0), uid(0), gid(0), mode(0), size(0), file_offset(0), file_size(0) {} diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -20,6 +20,8 @@ using namespace lldb_private; using namespace llvm::MachO; +LLDB_PLUGIN(ObjectContainerUniversalMachO); + void ObjectContainerUniversalMachO::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance, diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp --- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp +++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp @@ -16,6 +16,8 @@ using namespace lldb_private; using namespace lldb_private::breakpad; +LLDB_PLUGIN(ObjectFileBreakpad); + namespace { struct Header { ArchSpec arch; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -51,6 +51,8 @@ using namespace elf; using namespace llvm::ELF; +LLDB_PLUGIN(ObjectFileELF); + namespace { // ELF note owner definitions diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -66,6 +66,8 @@ using namespace lldb_private; using namespace llvm::MachO; +LLDB_PLUGIN(ObjectFileMachO); + // Some structure definitions needed for parsing the dyld shared cache files // found on iOS devices. diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -41,6 +41,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ObjectFilePECOFF); + struct CVInfoPdb70 { // 16-byte GUID struct _Guid { diff --git a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp --- a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp +++ b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp @@ -28,6 +28,8 @@ using namespace lldb_private; using namespace lldb_private::wasm; +LLDB_PLUGIN(ObjectFileWasm); + static const uint32_t kWasmHeaderSize = sizeof(llvm::wasm::WasmMagic) + sizeof(llvm::wasm::WasmVersion); diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -39,6 +39,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(OperatingSystemPython); + void OperatingSystemPython::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance, diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -26,6 +26,8 @@ using namespace lldb_private::platform_android; using namespace std::chrono; +LLDB_PLUGIN(PlatformAndroid); + static uint32_t g_initialize_count = 0; static const unsigned int g_android_default_cache_size = 2048; // Fits inside 4k adb packet. diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -36,6 +36,8 @@ using namespace lldb_private; using namespace lldb_private::platform_freebsd; +LLDB_PLUGIN(PlatformFreeBSD); + static uint32_t g_initialize_count = 0; diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -34,6 +34,8 @@ using namespace lldb_private; using namespace lldb_private::platform_linux; +LLDB_PLUGIN(PlatformLinux); + static uint32_t g_initialize_count = 0; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -38,6 +38,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(PlatformMacOSX); + static uint32_t g_initialize_count = 0; void PlatformMacOSX::Initialize() { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -25,6 +25,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(PlatformRemoteiOS); + // Static Variables static uint32_t g_initialize_count = 0; diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -34,6 +34,8 @@ using namespace lldb_private; using namespace lldb_private::platform_netbsd; +LLDB_PLUGIN(PlatformNetBSD); + static uint32_t g_initialize_count = 0; diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp @@ -34,6 +34,8 @@ using namespace lldb_private; using namespace lldb_private::platform_openbsd; +LLDB_PLUGIN(PlatformOpenBSD); + static uint32_t g_initialize_count = 0; diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -27,6 +27,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(PlatformWindows); + static uint32_t g_initialize_count = 0; namespace { diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -35,6 +35,8 @@ using namespace lldb_private; using namespace lldb_private::platform_gdb_server; +LLDB_PLUGIN(PlatformRemoteGDBServer); + static bool g_initialized = false; void PlatformRemoteGDBServer::Initialize() { diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -56,6 +56,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ProcessFreeBSD); + namespace { UnixSignalsSP &GetFreeBSDSignals() { static UnixSignalsSP s_freebsd_signals_sp(new FreeBSDSignals()); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -50,6 +50,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ProcessKDP); + namespace { #define LLDB_PROPERTIES_processkdp diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -44,6 +44,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ProcessWindows); + namespace { std::string GetProcessExecutableName(HANDLE process_handle) { std::vector file_name; diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -35,6 +35,8 @@ using namespace lldb_private; namespace ELF = llvm::ELF; +LLDB_PLUGIN(ProcessElfCore); + ConstString ProcessElfCore::GetPluginNameStatic() { static ConstString g_name("elf-core"); return g_name; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -90,6 +90,8 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; +LLDB_PLUGIN(ProcessGDBRemote); + namespace lldb { // Provide a function that can easily dump the packet history if we know a // ProcessGDBRemote * value (which we can get from logs or from debugging). We diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -44,6 +44,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ProcessMachCore); + ConstString ProcessMachCore::GetPluginNameStatic() { static ConstString g_name("mach-o-core"); return g_name; diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp --- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp +++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp @@ -41,6 +41,8 @@ using namespace lldb_private; using namespace minidump; +LLDB_PLUGIN(ProcessMinidump); + namespace { /// A minimal ObjectFile implementation providing a dummy object file for the diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp @@ -19,6 +19,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ScriptInterpreterLua); + class IOHandlerLuaInterpreter : public IOHandlerDelegate, public IOHandlerEditline { public: diff --git a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp --- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp @@ -20,6 +20,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(ScriptInterpreterNone); + ScriptInterpreterNone::ScriptInterpreterNone(Debugger &debugger) : ScriptInterpreter(debugger, eScriptLanguageNone) {} diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -56,6 +56,8 @@ using namespace lldb_private::python; using llvm::Expected; +LLDB_PLUGIN(ScriptInterpreterPython); + // Defined in the SWIG source file #if PY_MAJOR_VERSION >= 3 extern "C" PyObject *PyInit__lldb(void); diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -36,6 +36,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(StructuredDataDarwinLog); + #pragma mark - #pragma mark Anonymous Namespace diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp @@ -25,6 +25,8 @@ using namespace lldb_private; using namespace lldb_private::breakpad; +LLDB_PLUGIN(SymbolFileBreakpad); + char SymbolFileBreakpad::ID; class SymbolFileBreakpad::LineIterator { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -94,6 +94,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SymbolFileDWARF); + char SymbolFileDWARF::ID; // static inline bool diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -39,6 +39,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SymbolFileDWARFDebugMap); + char SymbolFileDWARFDebugMap::ID; // Subclass lldb_private::Module so we can intercept the diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -58,6 +58,8 @@ using namespace lldb_private; using namespace llvm::pdb; +LLDB_PLUGIN(SymbolFilePDB); + char SymbolFilePDB::ID; namespace { diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -25,6 +25,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SymbolFileSymtab); + char SymbolFileSymtab::ID; void SymbolFileSymtab::Initialize() { diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -25,6 +25,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SymbolVendorELF); + // SymbolVendorELF constructor SymbolVendorELF::SymbolVendorELF(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -26,6 +26,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SymbolVendorMacOSX); + // SymbolVendorMacOSX constructor SymbolVendorMacOSX::SymbolVendorMacOSX(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} diff --git a/lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp b/lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp --- a/lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp +++ b/lldb/source/Plugins/SymbolVendor/wasm/SymbolVendorWasm.cpp @@ -26,6 +26,8 @@ using namespace lldb_private; using namespace lldb_private::wasm; +LLDB_PLUGIN(SymbolVendorWasm); + // SymbolVendorWasm constructor SymbolVendorWasm::SymbolVendorWasm(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -34,6 +34,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(SystemRuntimeMacOSX); + // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -81,6 +81,8 @@ using namespace clang; using llvm::StringSwitch; +LLDB_PLUGIN(TypeSystemClang); + namespace { #ifdef LLDB_CONFIGURATION_DEBUG static void VerifyDecl(clang::Decl *decl) { diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -28,6 +28,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(UnwindAssemblyInstEmulation); + // UnwindAssemblyInstEmulation method definitions bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly( diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -30,6 +30,8 @@ using namespace lldb; using namespace lldb_private; +LLDB_PLUGIN(UnwindAssembly_x86); + // UnwindAssemblyParser_x86 method definitions UnwindAssembly_x86::UnwindAssembly_x86(const ArchSpec &arch) diff --git a/lldb/tools/lldb-test/SystemInitializerTest.cpp b/lldb/tools/lldb-test/SystemInitializerTest.cpp --- a/lldb/tools/lldb-test/SystemInitializerTest.cpp +++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp @@ -7,103 +7,12 @@ //===----------------------------------------------------------------------===// #include "SystemInitializerTest.h" - #include "lldb/Core/Debugger.h" +#include "lldb/Core/PluginManager.h" #include "lldb/Host/Host.h" #include "lldb/Initialization/SystemInitializerCommon.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Utility/Timer.h" - -#include "Plugins/ABI/AArch64/ABIMacOSX_arm64.h" -#include "Plugins/ABI/AArch64/ABISysV_arm64.h" -#include "Plugins/ABI/ARC/ABISysV_arc.h" -#include "Plugins/ABI/ARM/ABIMacOSX_arm.h" -#include "Plugins/ABI/ARM/ABISysV_arm.h" -#include "Plugins/ABI/Hexagon/ABISysV_hexagon.h" -#include "Plugins/ABI/Mips/ABISysV_mips.h" -#include "Plugins/ABI/Mips/ABISysV_mips64.h" -#include "Plugins/ABI/PowerPC/ABISysV_ppc.h" -#include "Plugins/ABI/PowerPC/ABISysV_ppc64.h" -#include "Plugins/ABI/SystemZ/ABISysV_s390x.h" -#include "Plugins/ABI/X86/ABIMacOSX_i386.h" -#include "Plugins/ABI/X86/ABISysV_i386.h" -#include "Plugins/ABI/X86/ABISysV_x86_64.h" -#include "Plugins/ABI/X86/ABIWindows_x86_64.h" -#include "Plugins/Architecture/Arm/ArchitectureArm.h" -#include "Plugins/Architecture/Mips/ArchitectureMips.h" -#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h" -#include "Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h" -#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h" -#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h" -#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h" -#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h" -#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h" -#include "Plugins/Instruction/ARM/EmulateInstructionARM.h" -#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" -#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h" -#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h" -#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h" -#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h" -#include "Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.h" -#include "Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h" -#include "Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h" -#include "Plugins/JITLoader/GDB/JITLoaderGDB.h" -#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h" -#include "Plugins/Language/ObjC/ObjCLanguage.h" -#include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h" -#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h" -#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" -#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h" -#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h" -#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h" -#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h" -#include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h" -#include "Plugins/ObjectFile/ELF/ObjectFileELF.h" -#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" -#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h" -#include "Plugins/ObjectFile/wasm/ObjectFileWasm.h" -#include "Plugins/Platform/Android/PlatformAndroid.h" -#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h" -#include "Plugins/Platform/Linux/PlatformLinux.h" -#include "Plugins/Platform/MacOSX/PlatformMacOSX.h" -#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h" -#include "Plugins/Platform/NetBSD/PlatformNetBSD.h" -#include "Plugins/Platform/OpenBSD/PlatformOpenBSD.h" -#include "Plugins/Platform/Windows/PlatformWindows.h" -#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" -#include "Plugins/Process/elf-core/ProcessElfCore.h" -#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" -#include "Plugins/Process/mach-core/ProcessMachCore.h" -#include "Plugins/Process/minidump/ProcessMinidump.h" -#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h" -#include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h" -#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" -#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" -#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h" -#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" -#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h" -#include "Plugins/SymbolVendor/wasm/SymbolVendorWasm.h" -#include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h" -#include "Plugins/TypeSystem/Clang/TypeSystemClang.h" -#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" -#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h" - -#if defined(__APPLE__) -#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h" -#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h" -#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h" -#endif -#include "Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h" - -#if defined(__FreeBSD__) -#include "Plugins/Process/FreeBSD/ProcessFreeBSD.h" -#endif - -#if defined(_WIN32) -#include "Plugins/Process/Windows/Common/ProcessWindows.h" -#include "lldb/Host/windows/windows.h" -#endif - #include "llvm/Support/TargetSelect.h" #include @@ -115,24 +24,24 @@ SystemInitializerTest::~SystemInitializerTest() {} #define LLDB_PROCESS_AArch64(op) \ - ABIMacOSX_arm64::op(); \ - ABISysV_arm64::op(); + op(ABIMacOSX_arm64); \ + op(ABISysV_arm64); #define LLDB_PROCESS_ARM(op) \ - ABIMacOSX_arm::op(); \ - ABISysV_arm::op(); -#define LLDB_PROCESS_Hexagon(op) ABISysV_hexagon::op(); + op(ABIMacOSX_arm); \ + op(ABISysV_arm); +#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon); #define LLDB_PROCESS_Mips(op) \ - ABISysV_mips::op(); \ - ABISysV_mips64::op(); + op(ABISysV_mips); \ + op(ABISysV_mips64); #define LLDB_PROCESS_PowerPC(op) \ - ABISysV_ppc::op(); \ - ABISysV_ppc64::op(); -#define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op(); + op(ABISysV_ppc); \ + op(ABISysV_ppc64); +#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x); #define LLDB_PROCESS_X86(op) \ - ABIMacOSX_i386::op(); \ - ABISysV_i386::op(); \ - ABISysV_x86_64::op(); \ - ABIWindows_x86_64::op(); + op(ABIMacOSX_i386); \ + op(ABISysV_i386); \ + op(ABISysV_x86_64); \ + op(ABIWindows_x86_64); #define LLDB_PROCESS_AMDGPU(op) #define LLDB_PROCESS_ARC(op) @@ -150,25 +59,25 @@ if (auto e = SystemInitializerCommon::Initialize()) return e; - breakpad::ObjectFileBreakpad::Initialize(); - ObjectFileELF::Initialize(); - ObjectFileMachO::Initialize(); - ObjectFilePECOFF::Initialize(); - wasm::ObjectFileWasm::Initialize(); + LLDB_PLUGIN_INITIALIZE(ObjectFileBreakpad); + LLDB_PLUGIN_INITIALIZE(ObjectFileELF); + LLDB_PLUGIN_INITIALIZE(ObjectFileMachO); + LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF); + LLDB_PLUGIN_INITIALIZE(ObjectFileWasm); - ObjectContainerBSDArchive::Initialize(); - ObjectContainerUniversalMachO::Initialize(); + LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive); + LLDB_PLUGIN_INITIALIZE(ObjectContainerUniversalMachO); - ScriptInterpreterNone::Initialize(); + LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone); - platform_freebsd::PlatformFreeBSD::Initialize(); - platform_linux::PlatformLinux::Initialize(); - platform_netbsd::PlatformNetBSD::Initialize(); - platform_openbsd::PlatformOpenBSD::Initialize(); - PlatformWindows::Initialize(); - platform_android::PlatformAndroid::Initialize(); - PlatformRemoteiOS::Initialize(); - PlatformMacOSX::Initialize(); + LLDB_PLUGIN_INITIALIZE(PlatformFreeBSD); + LLDB_PLUGIN_INITIALIZE(PlatformLinux); + LLDB_PLUGIN_INITIALIZE(PlatformNetBSD); + LLDB_PLUGIN_INITIALIZE(PlatformOpenBSD); + LLDB_PLUGIN_INITIALIZE(PlatformWindows); + LLDB_PLUGIN_INITIALIZE(PlatformAndroid); + LLDB_PLUGIN_INITIALIZE(PlatformRemoteiOS); + LLDB_PLUGIN_INITIALIZE(PlatformMacOSX); // Initialize LLVM and Clang llvm::InitializeAllTargets(); @@ -176,82 +85,83 @@ llvm::InitializeAllTargetMCs(); llvm::InitializeAllDisassemblers(); - TypeSystemClang::Initialize(); + LLDB_PLUGIN_INITIALIZE(TypeSystemClang); -#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Initialize) +#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_INITIALIZE) #include "llvm/Config/Targets.def" - ArchitectureArm::Initialize(); - ArchitectureMips::Initialize(); - ArchitecturePPC64::Initialize(); - - DisassemblerLLVMC::Initialize(); - - JITLoaderGDB::Initialize(); - ProcessElfCore::Initialize(); - ProcessMachCore::Initialize(); - minidump::ProcessMinidump::Initialize(); - MemoryHistoryASan::Initialize(); - InstrumentationRuntimeASan::Initialize(); - InstrumentationRuntimeTSan::Initialize(); - InstrumentationRuntimeUBSan::Initialize(); - InstrumentationRuntimeMainThreadChecker::Initialize(); - - SymbolVendorELF::Initialize(); - breakpad::SymbolFileBreakpad::Initialize(); - SymbolFileDWARF::Initialize(); - SymbolFilePDB::Initialize(); - SymbolFileSymtab::Initialize(); - wasm::SymbolVendorWasm::Initialize(); - UnwindAssemblyInstEmulation::Initialize(); - UnwindAssembly_x86::Initialize(); - - EmulateInstructionARM::Initialize(); - EmulateInstructionARM64::Initialize(); - EmulateInstructionMIPS::Initialize(); - EmulateInstructionMIPS64::Initialize(); - EmulateInstructionPPC64::Initialize(); - - SymbolFileDWARFDebugMap::Initialize(); - ItaniumABILanguageRuntime::Initialize(); - AppleObjCRuntime::Initialize(); - SystemRuntimeMacOSX::Initialize(); - RenderScriptRuntime::Initialize(); - - CPlusPlusLanguage::Initialize(); - ObjCLanguage::Initialize(); - ObjCPlusPlusLanguage::Initialize(); + LLDB_PLUGIN_INITIALIZE(ArchitectureArm); + LLDB_PLUGIN_INITIALIZE(ArchitectureMips); + LLDB_PLUGIN_INITIALIZE(ArchitecturePPC64); + + LLDB_PLUGIN_INITIALIZE(DisassemblerLLVMC); + + LLDB_PLUGIN_INITIALIZE(JITLoaderGDB); + LLDB_PLUGIN_INITIALIZE(ProcessElfCore); + LLDB_PLUGIN_INITIALIZE(ProcessMachCore); + LLDB_PLUGIN_INITIALIZE(ProcessMinidump); + LLDB_PLUGIN_INITIALIZE(MemoryHistoryASan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeASan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeTSan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeUBSan); + LLDB_PLUGIN_INITIALIZE(InstrumentationRuntimeMainThreadChecker); + + LLDB_PLUGIN_INITIALIZE(SymbolVendorELF); + LLDB_PLUGIN_INITIALIZE(SymbolFileBreakpad); + LLDB_PLUGIN_INITIALIZE(SymbolFileDWARF); + LLDB_PLUGIN_INITIALIZE(SymbolFilePDB); + LLDB_PLUGIN_INITIALIZE(SymbolFileSymtab); + LLDB_PLUGIN_INITIALIZE(SymbolVendorWasm); + LLDB_PLUGIN_INITIALIZE(UnwindAssemblyInstEmulation); + LLDB_PLUGIN_INITIALIZE(UnwindAssembly_x86); + + LLDB_PLUGIN_INITIALIZE(EmulateInstructionARM); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionARM64); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionMIPS); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionMIPS64); + LLDB_PLUGIN_INITIALIZE(EmulateInstructionPPC64); + + LLDB_PLUGIN_INITIALIZE(SymbolFileDWARFDebugMap); + LLDB_PLUGIN_INITIALIZE(ItaniumABILanguageRuntime); + LLDB_PLUGIN_INITIALIZE(AppleObjCRuntime); + LLDB_PLUGIN_INITIALIZE(SystemRuntimeMacOSX); + LLDB_PLUGIN_INITIALIZE(RenderScriptRuntime); + + LLDB_PLUGIN_INITIALIZE(CPlusPlusLanguage); + LLDB_PLUGIN_INITIALIZE(ObjCLanguage); + LLDB_PLUGIN_INITIALIZE(ObjCPlusPlusLanguage); #if defined(_WIN32) - ProcessWindows::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessWindows); #endif #if defined(__FreeBSD__) - ProcessFreeBSD::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD); #endif #if defined(__APPLE__) - SymbolVendorMacOSX::Initialize(); - ProcessKDP::Initialize(); + LLDB_PLUGIN_INITIALIZE(SymbolVendorMacOSX); + LLDB_PLUGIN_INITIALIZE(ProcessKDP); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderDarwinKernel); #endif // This plugin is valid on any host that talks to a Darwin remote. It // shouldn't be limited to __APPLE__. - StructuredDataDarwinLog::Initialize(); + LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog); // Platform agnostic plugins - platform_gdb_server::PlatformRemoteGDBServer::Initialize(); + LLDB_PLUGIN_INITIALIZE(PlatformRemoteGDBServer); - process_gdb_remote::ProcessGDBRemote::Initialize(); - DynamicLoaderMacOSXDYLD::Initialize(); - DynamicLoaderMacOS::Initialize(); - DynamicLoaderPOSIXDYLD::Initialize(); - DynamicLoaderStatic::Initialize(); - DynamicLoaderWindowsDYLD::Initialize(); + LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOS); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderPOSIXDYLD); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic); + LLDB_PLUGIN_INITIALIZE(DynamicLoaderWindowsDYLD); // Scan for any system or user LLDB plug-ins PluginManager::Initialize(); - // The process settings need to know about installed plug-ins, so the Settings - // must be initialized + // The process settings need to know about installed plug-ins, so the + // Settings must be initialized // AFTER PluginManager::Initialize is called. Debugger::SettingsInitialize(); @@ -268,90 +178,93 @@ // Terminate and unload and loaded system or user LLDB plug-ins PluginManager::Terminate(); - TypeSystemClang::Terminate(); + LLDB_PLUGIN_TERMINATE(TypeSystemClang); - ArchitectureArm::Terminate(); - ArchitectureMips::Terminate(); - ArchitecturePPC64::Terminate(); + LLDB_PLUGIN_TERMINATE(ArchitectureArm); + LLDB_PLUGIN_TERMINATE(ArchitectureMips); + LLDB_PLUGIN_TERMINATE(ArchitecturePPC64); -#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Terminate) +#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_TERMINATE) #include "llvm/Config/Targets.def" - DisassemblerLLVMC::Terminate(); - - JITLoaderGDB::Terminate(); - ProcessElfCore::Terminate(); - ProcessMachCore::Terminate(); - minidump::ProcessMinidump::Terminate(); - MemoryHistoryASan::Terminate(); - InstrumentationRuntimeASan::Terminate(); - InstrumentationRuntimeTSan::Terminate(); - InstrumentationRuntimeUBSan::Terminate(); - InstrumentationRuntimeMainThreadChecker::Terminate(); - - wasm::SymbolVendorWasm::Terminate(); - SymbolVendorELF::Terminate(); - breakpad::SymbolFileBreakpad::Terminate(); - SymbolFileDWARF::Terminate(); - SymbolFilePDB::Terminate(); - SymbolFileSymtab::Terminate(); - UnwindAssembly_x86::Terminate(); - UnwindAssemblyInstEmulation::Terminate(); - - EmulateInstructionARM::Terminate(); - EmulateInstructionARM64::Terminate(); - EmulateInstructionMIPS::Terminate(); - EmulateInstructionMIPS64::Terminate(); - EmulateInstructionPPC64::Terminate(); - - SymbolFileDWARFDebugMap::Terminate(); - ItaniumABILanguageRuntime::Terminate(); - AppleObjCRuntime::Terminate(); - SystemRuntimeMacOSX::Terminate(); - RenderScriptRuntime::Terminate(); - - CPlusPlusLanguage::Terminate(); - ObjCLanguage::Terminate(); - ObjCPlusPlusLanguage::Terminate(); + LLDB_PLUGIN_TERMINATE(DisassemblerLLVMC); + + LLDB_PLUGIN_TERMINATE(JITLoaderGDB); + LLDB_PLUGIN_TERMINATE(ProcessElfCore); + LLDB_PLUGIN_TERMINATE(ProcessMachCore); + LLDB_PLUGIN_TERMINATE(ProcessMinidump); + LLDB_PLUGIN_TERMINATE(MemoryHistoryASan); + + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeASan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeTSan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeUBSan); + LLDB_PLUGIN_TERMINATE(InstrumentationRuntimeMainThreadChecker); + + LLDB_PLUGIN_TERMINATE(SymbolVendorWasm); + LLDB_PLUGIN_TERMINATE(SymbolVendorELF); + LLDB_PLUGIN_TERMINATE(SymbolFileBreakpad); + LLDB_PLUGIN_TERMINATE(SymbolFileDWARF); + LLDB_PLUGIN_TERMINATE(SymbolFilePDB); + LLDB_PLUGIN_TERMINATE(SymbolFileSymtab); + LLDB_PLUGIN_TERMINATE(UnwindAssembly_x86); + LLDB_PLUGIN_TERMINATE(UnwindAssemblyInstEmulation); + + LLDB_PLUGIN_TERMINATE(EmulateInstructionARM); + LLDB_PLUGIN_TERMINATE(EmulateInstructionARM64); + LLDB_PLUGIN_TERMINATE(EmulateInstructionMIPS); + LLDB_PLUGIN_TERMINATE(EmulateInstructionMIPS64); + LLDB_PLUGIN_TERMINATE(EmulateInstructionPPC64); + + LLDB_PLUGIN_TERMINATE(SymbolFileDWARFDebugMap); + LLDB_PLUGIN_TERMINATE(ItaniumABILanguageRuntime); + LLDB_PLUGIN_TERMINATE(AppleObjCRuntime); + LLDB_PLUGIN_TERMINATE(SystemRuntimeMacOSX); + LLDB_PLUGIN_TERMINATE(RenderScriptRuntime); + + LLDB_PLUGIN_TERMINATE(CPlusPlusLanguage); + LLDB_PLUGIN_TERMINATE(ObjCLanguage); + LLDB_PLUGIN_TERMINATE(ObjCPlusPlusLanguage); #if defined(__APPLE__) - DynamicLoaderDarwinKernel::Terminate(); - ProcessKDP::Terminate(); - SymbolVendorMacOSX::Terminate(); + LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel); + LLDB_PLUGIN_TERMINATE(ProcessKDP); + LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX); #endif #if defined(__FreeBSD__) - ProcessFreeBSD::Terminate(); + LLDB_PLUGIN_TERMINATE(ProcessFreeBSD); #endif Debugger::SettingsTerminate(); - platform_gdb_server::PlatformRemoteGDBServer::Terminate(); - process_gdb_remote::ProcessGDBRemote::Terminate(); - StructuredDataDarwinLog::Terminate(); - - DynamicLoaderMacOSXDYLD::Terminate(); - DynamicLoaderMacOS::Terminate(); - DynamicLoaderPOSIXDYLD::Terminate(); - DynamicLoaderStatic::Terminate(); - DynamicLoaderWindowsDYLD::Terminate(); - - platform_freebsd::PlatformFreeBSD::Terminate(); - platform_linux::PlatformLinux::Terminate(); - platform_netbsd::PlatformNetBSD::Terminate(); - platform_openbsd::PlatformOpenBSD::Terminate(); - PlatformWindows::Terminate(); - platform_android::PlatformAndroid::Terminate(); - PlatformMacOSX::Terminate(); - PlatformRemoteiOS::Terminate(); - - breakpad::ObjectFileBreakpad::Terminate(); - ObjectFileELF::Terminate(); - ObjectFileMachO::Terminate(); - ObjectFilePECOFF::Terminate(); - wasm::ObjectFileWasm::Terminate(); - - ObjectContainerBSDArchive::Terminate(); - ObjectContainerUniversalMachO::Terminate(); + LLDB_PLUGIN_TERMINATE(PlatformRemoteGDBServer); + LLDB_PLUGIN_TERMINATE(ProcessGDBRemote); + LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog); + + LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD); + LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOS); + LLDB_PLUGIN_TERMINATE(DynamicLoaderPOSIXDYLD); + LLDB_PLUGIN_TERMINATE(DynamicLoaderStatic); + LLDB_PLUGIN_TERMINATE(DynamicLoaderWindowsDYLD); + + LLDB_PLUGIN_TERMINATE(PlatformFreeBSD); + LLDB_PLUGIN_TERMINATE(PlatformLinux); + LLDB_PLUGIN_TERMINATE(PlatformNetBSD); + LLDB_PLUGIN_TERMINATE(PlatformOpenBSD); + LLDB_PLUGIN_TERMINATE(PlatformWindows); + LLDB_PLUGIN_TERMINATE(PlatformAndroid); + LLDB_PLUGIN_TERMINATE(PlatformRemoteiOS); + LLDB_PLUGIN_TERMINATE(PlatformMacOSX); + + LLDB_PLUGIN_TERMINATE(ObjectFileBreakpad); + LLDB_PLUGIN_TERMINATE(ObjectFileELF); + LLDB_PLUGIN_TERMINATE(ObjectFileMachO); + LLDB_PLUGIN_TERMINATE(ObjectFilePECOFF); + LLDB_PLUGIN_TERMINATE(ObjectFileWasm); + + LLDB_PLUGIN_TERMINATE(ObjectContainerBSDArchive); + LLDB_PLUGIN_TERMINATE(ObjectContainerUniversalMachO); + + LLDB_PLUGIN_TERMINATE(ScriptInterpreterNone); // Now shutdown the common parts, in reverse order. SystemInitializerCommon::Terminate();