[Lldb-commits] [lldb] 80c3ea4 - Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin"

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 18 19:16:17 PST 2020


Author: Jonas Devlieghere
Date: 2020-02-18T19:16:07-08:00
New Revision: 80c3ea4e633b440cb4bc2c36856d811353e474bb

URL: https://github.com/llvm/llvm-project/commit/80c3ea4e633b440cb4bc2c36856d811353e474bb
DIFF: https://github.com/llvm/llvm-project/commit/80c3ea4e633b440cb4bc2c36856d811353e474bb.diff

LOG: Re-land "[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin"

This patch changes the way we initialize and terminate the plugins in
the system initializer. It uses an approach similar to LLVM's
TARGETS_TO_BUILD with a def file that enumerates the plugins.

Previous attempts to land this failed on the Windows bot because there's
a dependency between the different process plugins. Apparently
ProcessWindowsCommon needs to be initialized after all other process
plugins but before ProcessGDBRemote.

Differential revision: https://reviews.llvm.org/D73067

Added: 
    

Modified: 
    lldb/source/API/SystemInitializerFull.cpp
    lldb/source/Plugins/CMakeLists.txt
    lldb/source/Plugins/Plugins.def.in
    lldb/tools/lldb-test/SystemInitializerTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp
index dfada58700c3..7f95e7acf62a 100644
--- a/lldb/source/API/SystemInitializerFull.cpp
+++ b/lldb/source/API/SystemInitializerFull.cpp
@@ -30,149 +30,26 @@
 using namespace lldb_private;
 
 SystemInitializerFull::SystemInitializerFull() = default;
-
 SystemInitializerFull::~SystemInitializerFull() = default;
 
-#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
-#define LLDB_PROCESS_ARM(op) op(ABIARM);
-#define LLDB_PROCESS_ARC(op) op(ABIARC);
-#define LLDB_PROCESS_Hexagon(op) op(ABIHexagon);
-#define LLDB_PROCESS_Mips(op) op(ABIMips);
-#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
-#define LLDB_PROCESS_SystemZ(op) op(ABISystemZ);
-#define LLDB_PROCESS_X86(op) op(ABIX86);
-
-#define LLDB_PROCESS_AMDGPU(op)
-#define LLDB_PROCESS_AVR(op)
-#define LLDB_PROCESS_BPF(op)
-#define LLDB_PROCESS_Lanai(op)
-#define LLDB_PROCESS_MSP430(op)
-#define LLDB_PROCESS_NVPTX(op)
-#define LLDB_PROCESS_RISCV(op)
-#define LLDB_PROCESS_Sparc(op)
-#define LLDB_PROCESS_WebAssembly(op)
-#define LLDB_PROCESS_XCore(op)
-
 llvm::Error SystemInitializerFull::Initialize() {
   if (auto e = SystemInitializerCommon::Initialize())
     return e;
 
-  LLDB_PLUGIN_INITIALIZE(ObjectFileBreakpad);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileELF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileJIT);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileMachO);
-  LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileWasm);
-
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerMachOArchive);
-
-  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
-
-#if LLDB_ENABLE_PYTHON
-  LLDB_PLUGIN_INITIALIZE(OperatingSystemPython);
-#endif
-
-#if LLDB_ENABLE_PYTHON
-  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterPython);
-#endif
-
-#if LLDB_ENABLE_LUA
-  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterLua);
-#endif
-  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(PlatformMacOSX);
-
   // Initialize LLVM and Clang
   llvm::InitializeAllTargets();
   llvm::InitializeAllAsmPrinters();
   llvm::InitializeAllTargetMCs();
   llvm::InitializeAllDisassemblers();
 
-  LLDB_PLUGIN_INITIALIZE(TypeSystemClang);
-
-#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_INITIALIZE)
-#include "llvm/Config/Targets.def"
-
-  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(UnwindAssemblyX86);
-
-  LLDB_PLUGIN_INITIALIZE(InstructionARM);
-  LLDB_PLUGIN_INITIALIZE(InstructionARM64);
-  LLDB_PLUGIN_INITIALIZE(InstructionMIPS);
-  LLDB_PLUGIN_INITIALIZE(InstructionMIPS64);
-  LLDB_PLUGIN_INITIALIZE(InstructionPPC64);
-
-  LLDB_PLUGIN_INITIALIZE(CXXItaniumABI);
-  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)
-  LLDB_PLUGIN_INITIALIZE(ProcessWindowsCommon);
-#endif
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD);
-#endif
-#if defined(__APPLE__)
-  LLDB_PLUGIN_INITIALIZE(SymbolVendorMacOSX);
-  LLDB_PLUGIN_INITIALIZE(ProcessMacOSXKernel);
-#endif
-
-  // This plugin is valid on any host that talks to a Darwin remote. It
-  // shouldn't be limited to __APPLE__.
-  LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog);
-
-  // Platform agnostic plugins
-  LLDB_PLUGIN_INITIALIZE(PlatformGDB);
-  LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote);
-
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderHexagonDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderPosixDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWasmDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWindowsDYLD);
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
+#include "Plugins/Plugins.def"
 
   // 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
-  // AFTER PluginManager::Initialize is called.
-
+  // Settings must be initialized AFTER PluginManager::Initialize is called.
   Debugger::SettingsInitialize();
 
   return llvm::Error::success();
@@ -187,105 +64,8 @@ void SystemInitializerFull::Terminate() {
   // Terminate and unload and loaded system or user LLDB plug-ins
   PluginManager::Terminate();
 
-  LLDB_PLUGIN_TERMINATE(TypeSystemClang);
-
-  LLDB_PLUGIN_TERMINATE(ArchitectureArm);
-  LLDB_PLUGIN_TERMINATE(ArchitectureMips);
-  LLDB_PLUGIN_TERMINATE(ArchitecturePPC64);
-
-#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_TERMINATE)
-#include "llvm/Config/Targets.def"
-
-  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(UnwindAssemblyX86);
-  LLDB_PLUGIN_TERMINATE(UnwindAssemblyInstEmulation);
-
-  LLDB_PLUGIN_TERMINATE(InstructionARM);
-  LLDB_PLUGIN_TERMINATE(InstructionARM64);
-  LLDB_PLUGIN_TERMINATE(InstructionMIPS);
-  LLDB_PLUGIN_TERMINATE(InstructionMIPS64);
-  LLDB_PLUGIN_TERMINATE(InstructionPPC64);
-
-  LLDB_PLUGIN_TERMINATE(CXXItaniumABI);
-  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__)
-  LLDB_PLUGIN_TERMINATE(ProcessMacOSXKernel);
-  LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX);
-#endif
-
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_TERMINATE(ProcessFreeBSD);
-#endif
-  Debugger::SettingsTerminate();
-
-  LLDB_PLUGIN_TERMINATE(PlatformGDB);
-  LLDB_PLUGIN_TERMINATE(ProcessGDBRemote);
-  LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog);
-
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderHexagonDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderPosixDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderStatic);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderWasmDYLD);
-  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(PlatformMacOSX);
-
-  LLDB_PLUGIN_TERMINATE(ObjectFileBreakpad);
-  LLDB_PLUGIN_TERMINATE(ObjectFileELF);
-  LLDB_PLUGIN_TERMINATE(ObjectFileJIT);
-  LLDB_PLUGIN_TERMINATE(ObjectFileMachO);
-  LLDB_PLUGIN_TERMINATE(ObjectFilePECOFF);
-  LLDB_PLUGIN_TERMINATE(ObjectFileWasm);
-
-  LLDB_PLUGIN_TERMINATE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_TERMINATE(ObjectContainerMachOArchive);
-
-#if LLDB_ENABLE_PYTHON
-  LLDB_PLUGIN_TERMINATE(OperatingSystemPython);
-#endif
-
-#if LLDB_ENABLE_PYTHON
-  LLDB_PLUGIN_TERMINATE(ScriptInterpreterPython);
-#endif
-
-#if LLDB_ENABLE_LUA
-  LLDB_PLUGIN_TERMINATE(ScriptInterpreterLua);
-#endif
-
-  LLDB_PLUGIN_TERMINATE(ScriptInterpreterNone);
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_TERMINATE(p);
+#include "Plugins/Plugins.def"
 
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();

diff  --git a/lldb/source/Plugins/CMakeLists.txt b/lldb/source/Plugins/CMakeLists.txt
index 24fb85811797..d91ba749f86c 100644
--- a/lldb/source/Plugins/CMakeLists.txt
+++ b/lldb/source/Plugins/CMakeLists.txt
@@ -27,11 +27,20 @@ get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
 set(LLDB_ENUM_PLUGINS "")
 
+# FIXME: ProcessWindowsCommon needs to be initialized after all other process
+# plugins but before ProcessGDBRemote.
+set(LLDB_PROCESS_WINDOWS_PLUGIN "")
+set(LLDB_PROCESS_GDB_PLUGIN "")
+
 foreach(p ${LLDB_ALL_PLUGINS})
   # Strip lldbPlugin form the plugin name.
   string(SUBSTRING ${p} 10 -1 pStripped)
   if(${pStripped} MATCHES "^ScriptInterpreter*")
     set(LLDB_ENUM_PLUGINS "${LLDB_ENUM_PLUGINS}LLDB_SCRIPT_PLUGIN(${pStripped})\n")
+  elseif(${pStripped} STREQUAL "ProcessWindowsCommon")
+    set(LLDB_PROCESS_WINDOWS_PLUGIN "LLDB_PLUGIN(${pStripped})\n")
+  elseif(${pStripped} STREQUAL "ProcessGDBRemote")
+    set(LLDB_PROCESS_GDB_PLUGIN "LLDB_PLUGIN(${pStripped})\n")
   else()
     set(LLDB_ENUM_PLUGINS "${LLDB_ENUM_PLUGINS}LLDB_PLUGIN(${pStripped})\n")
   endif()

diff  --git a/lldb/source/Plugins/Plugins.def.in b/lldb/source/Plugins/Plugins.def.in
index 926ab6d024a7..bf54598fb2f3 100644
--- a/lldb/source/Plugins/Plugins.def.in
+++ b/lldb/source/Plugins/Plugins.def.in
@@ -30,6 +30,8 @@
 #endif
 
 @LLDB_ENUM_PLUGINS@
+ at LLDB_PROCESS_WINDOWS_PLUGIN@
+ at LLDB_PROCESS_GDB_PLUGIN@
 
 #undef LLDB_PLUGIN
 #undef LLDB_SCRIPT_PLUGIN

diff  --git a/lldb/tools/lldb-test/SystemInitializerTest.cpp b/lldb/tools/lldb-test/SystemInitializerTest.cpp
index eceee50b5a4f..10b90cdc6409 100644
--- a/lldb/tools/lldb-test/SystemInitializerTest.cpp
+++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp
@@ -22,139 +22,32 @@
 
 using namespace lldb_private;
 
-SystemInitializerTest::SystemInitializerTest() {}
-
-SystemInitializerTest::~SystemInitializerTest() {}
-
-#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
-#define LLDB_PROCESS_ARM(op) op(ABIARM);
-#define LLDB_PROCESS_ARC(op) op(ABIARC);
-#define LLDB_PROCESS_Hexagon(op) op(ABIHexagon);
-#define LLDB_PROCESS_Mips(op) op(ABIMips);
-#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
-#define LLDB_PROCESS_SystemZ(op) op(ABISystemZ);
-#define LLDB_PROCESS_X86(op) op(ABIX86);
-
-#define LLDB_PROCESS_AMDGPU(op)
-#define LLDB_PROCESS_AVR(op)
-#define LLDB_PROCESS_BPF(op)
-#define LLDB_PROCESS_Lanai(op)
-#define LLDB_PROCESS_MSP430(op)
-#define LLDB_PROCESS_NVPTX(op)
-#define LLDB_PROCESS_RISCV(op)
-#define LLDB_PROCESS_Sparc(op)
-#define LLDB_PROCESS_WebAssembly(op)
-#define LLDB_PROCESS_XCore(op)
+SystemInitializerTest::SystemInitializerTest() = default;
+SystemInitializerTest::~SystemInitializerTest() = default;
 
 llvm::Error SystemInitializerTest::Initialize() {
   if (auto e = SystemInitializerCommon::Initialize())
     return e;
 
-  LLDB_PLUGIN_INITIALIZE(ObjectFileBreakpad);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileELF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileJIT);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileMachO);
-  LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileWasm);
-
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerMachOArchive);
-
-  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
-
-  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(PlatformMacOSX);
-
   // Initialize LLVM and Clang
   llvm::InitializeAllTargets();
   llvm::InitializeAllAsmPrinters();
   llvm::InitializeAllTargetMCs();
   llvm::InitializeAllDisassemblers();
 
-  LLDB_PLUGIN_INITIALIZE(TypeSystemClang);
-
-#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_INITIALIZE)
-#include "llvm/Config/Targets.def"
-
-  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(UnwindAssemblyX86);
-
-  LLDB_PLUGIN_INITIALIZE(InstructionARM);
-  LLDB_PLUGIN_INITIALIZE(InstructionARM64);
-  LLDB_PLUGIN_INITIALIZE(InstructionMIPS);
-  LLDB_PLUGIN_INITIALIZE(InstructionMIPS64);
-  LLDB_PLUGIN_INITIALIZE(InstructionPPC64);
-
-  LLDB_PLUGIN_INITIALIZE(CXXItaniumABI);
-  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)
-  LLDB_PLUGIN_INITIALIZE(ProcessWindowsCommon);
-#endif
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD);
-#endif
-#if defined(__APPLE__)
-  LLDB_PLUGIN_INITIALIZE(SymbolVendorMacOSX);
-  LLDB_PLUGIN_INITIALIZE(ProcessMacOSXKernel);
-#endif
-
-  // This plugin is valid on any host that talks to a Darwin remote. It
-  // shouldn't be limited to __APPLE__.
-  LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog);
-
-  // Platform agnostic plugins
-  LLDB_PLUGIN_INITIALIZE(PlatformGDB);
-  LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote);
+#define LLDB_SCRIPT_PLUGIN(p)
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
+#include "Plugins/Plugins.def"
 
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderHexagonDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderPosixDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWasmDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWindowsDYLD);
+  // We ignored all the script interpreter earlier, so initialize
+  // ScriptInterpreterNone explicitly.
+  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
 
   // 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
-  // AFTER PluginManager::Initialize is called.
-
+  // Settings must be initialized AFTER PluginManager::Initialize is called.
   Debugger::SettingsInitialize();
 
   return llvm::Error::success();
@@ -169,93 +62,13 @@ void SystemInitializerTest::Terminate() {
   // Terminate and unload and loaded system or user LLDB plug-ins
   PluginManager::Terminate();
 
-  LLDB_PLUGIN_TERMINATE(TypeSystemClang);
-
-  LLDB_PLUGIN_TERMINATE(ArchitectureArm);
-  LLDB_PLUGIN_TERMINATE(ArchitectureMips);
-  LLDB_PLUGIN_TERMINATE(ArchitecturePPC64);
-
-#define LLVM_TARGET(t) LLDB_PROCESS_##t(LLDB_PLUGIN_TERMINATE)
-#include "llvm/Config/Targets.def"
-
-  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(UnwindAssemblyX86);
-  LLDB_PLUGIN_TERMINATE(UnwindAssemblyInstEmulation);
-
-  LLDB_PLUGIN_TERMINATE(InstructionARM);
-  LLDB_PLUGIN_TERMINATE(InstructionARM64);
-  LLDB_PLUGIN_TERMINATE(InstructionMIPS);
-  LLDB_PLUGIN_TERMINATE(InstructionMIPS64);
-  LLDB_PLUGIN_TERMINATE(InstructionPPC64);
-
-  LLDB_PLUGIN_TERMINATE(CXXItaniumABI);
-  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__)
-  LLDB_PLUGIN_TERMINATE(ProcessMacOSXKernel);
-  LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX);
-#endif
-
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_TERMINATE(ProcessFreeBSD);
-#endif
-  Debugger::SettingsTerminate();
-
-  LLDB_PLUGIN_TERMINATE(PlatformGDB);
-  LLDB_PLUGIN_TERMINATE(ProcessGDBRemote);
-  LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog);
-
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderHexagonDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderPosixDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderStatic);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderWasmDYLD);
-  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(PlatformMacOSX);
-
-  LLDB_PLUGIN_TERMINATE(ObjectFileBreakpad);
-  LLDB_PLUGIN_TERMINATE(ObjectFileELF);
-  LLDB_PLUGIN_TERMINATE(ObjectFileJIT);
-  LLDB_PLUGIN_TERMINATE(ObjectFileMachO);
-  LLDB_PLUGIN_TERMINATE(ObjectFilePECOFF);
-  LLDB_PLUGIN_TERMINATE(ObjectFileWasm);
-
-  LLDB_PLUGIN_TERMINATE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_TERMINATE(ObjectContainerMachOArchive);
+#define LLDB_SCRIPT_PLUGIN(p)
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_TERMINATE(p);
+#include "Plugins/Plugins.def"
 
-  LLDB_PLUGIN_TERMINATE(ScriptInterpreterNone);
+  // We ignored all the script interpreter earlier, so terminate
+  // ScriptInterpreterNone explicitly.
+  LLDB_PLUGIN_INITIALIZE(ScriptInterpreterNone);
 
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();


        


More information about the lldb-commits mailing list