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

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 17 14:44:19 PST 2020


Author: Jonas Devlieghere
Date: 2020-02-17T14:43:05-08:00
New Revision: 9b12dc98fd0821f8d1f7f6304a314b6417d6ae3d

URL: https://github.com/llvm/llvm-project/commit/9b12dc98fd0821f8d1f7f6304a314b6417d6ae3d
DIFF: https://github.com/llvm/llvm-project/commit/9b12dc98fd0821f8d1f7f6304a314b6417d6ae3d.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.

The previously landed patch got reverted because it was lacking:

 (1) A plugin definition for the Objective-C language runtime,
 (2) The dependency between the Static and WASM dynamic loader,
 (3) Explicit initialization of ScriptInterpreterNone for lldb-test.

All issues have been addressed in this patch.

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

Added: 
    lldb/source/Plugins/Plugins.def.in

Modified: 
    lldb/include/lldb/Core/PluginManager.h
    lldb/source/API/SystemInitializerFull.cpp
    lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
    lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
    lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
    lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
    lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
    lldb/source/Plugins/CMakeLists.txt
    lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
    lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
    lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
    lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
    lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
    lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
    lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
    lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt
    lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
    lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
    lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
    lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
    lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
    lldb/source/Plugins/OperatingSystem/CMakeLists.txt
    lldb/source/Plugins/Platform/POSIX/CMakeLists.txt
    lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
    lldb/source/Plugins/Process/Utility/CMakeLists.txt
    lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
    lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
    lldb/tools/lldb-test/CMakeLists.txt
    lldb/tools/lldb-test/SystemInitializerTest.cpp
    lldb/unittests/Disassembler/CMakeLists.txt
    lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
    lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h
index 1544ecc386c7..d42e53ac6fe3 100644
--- a/lldb/include/lldb/Core/PluginManager.h
+++ b/lldb/include/lldb/Core/PluginManager.h
@@ -22,12 +22,15 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#define LLDB_PLUGIN_DEFINE(PluginName)                                         \
+#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)                          \
   namespace lldb_private {                                                     \
-  void lldb_initialize_##PluginName() { PluginName::Initialize(); }            \
-  void lldb_terminate_##PluginName() { PluginName::Terminate(); }              \
+  void lldb_initialize_##PluginName() { ClassName::Initialize(); }             \
+  void lldb_terminate_##PluginName() { ClassName::Terminate(); }               \
   }
 
+#define LLDB_PLUGIN_DEFINE(PluginName)                                         \
+  LLDB_PLUGIN_DEFINE_ADV(PluginName, PluginName)
+
 // FIXME: Generate me with CMake
 #define LLDB_PLUGIN_DECLARE(PluginName)                                        \
   namespace lldb_private {                                                     \

diff  --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp
index b629e53e9dfe..f6b37c5bfebd 100644
--- a/lldb/source/API/SystemInitializerFull.cpp
+++ b/lldb/source/API/SystemInitializerFull.cpp
@@ -24,89 +24,8 @@
 
 #include <string>
 
-LLDB_PLUGIN_DECLARE(ABIAArch64)
-LLDB_PLUGIN_DECLARE(ABIARM)
-LLDB_PLUGIN_DECLARE(ABISysV_arc)
-LLDB_PLUGIN_DECLARE(ABISysV_hexagon)
-LLDB_PLUGIN_DECLARE(ABIMips)
-LLDB_PLUGIN_DECLARE(ABIPowerPC)
-LLDB_PLUGIN_DECLARE(ABISysV_s390x)
-LLDB_PLUGIN_DECLARE(ABIX86)
-LLDB_PLUGIN_DECLARE(ObjectFileBreakpad)
-LLDB_PLUGIN_DECLARE(ObjectFileELF)
-LLDB_PLUGIN_DECLARE(ObjectFileMachO)
-LLDB_PLUGIN_DECLARE(ObjectFilePECOFF)
-LLDB_PLUGIN_DECLARE(ObjectFileWasm)
-LLDB_PLUGIN_DECLARE(ObjectContainerBSDArchive)
-LLDB_PLUGIN_DECLARE(ObjectContainerUniversalMachO)
-LLDB_PLUGIN_DECLARE(ScriptInterpreterNone)
-#if LLDB_ENABLE_PYTHON
-LLDB_PLUGIN_DECLARE(OperatingSystemPython)
-LLDB_PLUGIN_DECLARE(ScriptInterpreterPython)
-#endif
-#if LLDB_ENABLE_LUA
-LLDB_PLUGIN_DECLARE(ScriptInterpreterLua)
-#endif
-LLDB_PLUGIN_DECLARE(PlatformFreeBSD)
-LLDB_PLUGIN_DECLARE(PlatformLinux)
-LLDB_PLUGIN_DECLARE(PlatformNetBSD)
-LLDB_PLUGIN_DECLARE(PlatformOpenBSD)
-LLDB_PLUGIN_DECLARE(PlatformWindows)
-LLDB_PLUGIN_DECLARE(PlatformAndroid)
-LLDB_PLUGIN_DECLARE(PlatformMacOSX)
-LLDB_PLUGIN_DECLARE(TypeSystemClang)
-LLDB_PLUGIN_DECLARE(ArchitectureArm)
-LLDB_PLUGIN_DECLARE(ArchitectureMips)
-LLDB_PLUGIN_DECLARE(ArchitecturePPC64)
-LLDB_PLUGIN_DECLARE(DisassemblerLLVMC)
-LLDB_PLUGIN_DECLARE(JITLoaderGDB)
-LLDB_PLUGIN_DECLARE(ProcessElfCore)
-LLDB_PLUGIN_DECLARE(ProcessMachCore)
-LLDB_PLUGIN_DECLARE(ProcessMinidump)
-LLDB_PLUGIN_DECLARE(MemoryHistoryASan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeASan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeTSan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeUBSan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeMainThreadChecker)
-LLDB_PLUGIN_DECLARE(SymbolVendorELF)
-LLDB_PLUGIN_DECLARE(SymbolFileBreakpad)
-LLDB_PLUGIN_DECLARE(SymbolFileDWARF)
-LLDB_PLUGIN_DECLARE(SymbolFilePDB)
-LLDB_PLUGIN_DECLARE(SymbolFileSymtab)
-LLDB_PLUGIN_DECLARE(SymbolVendorWasm)
-LLDB_PLUGIN_DECLARE(UnwindAssemblyInstEmulation)
-LLDB_PLUGIN_DECLARE(UnwindAssembly_x86)
-LLDB_PLUGIN_DECLARE(EmulateInstructionARM)
-LLDB_PLUGIN_DECLARE(EmulateInstructionARM64)
-LLDB_PLUGIN_DECLARE(EmulateInstructionMIPS)
-LLDB_PLUGIN_DECLARE(EmulateInstructionMIPS64)
-LLDB_PLUGIN_DECLARE(EmulateInstructionPPC64)
-LLDB_PLUGIN_DECLARE(ItaniumABILanguageRuntime)
-LLDB_PLUGIN_DECLARE(AppleObjCRuntime)
-LLDB_PLUGIN_DECLARE(SystemRuntimeMacOSX)
-LLDB_PLUGIN_DECLARE(RenderScriptRuntime)
-LLDB_PLUGIN_DECLARE(CPlusPlusLanguage)
-LLDB_PLUGIN_DECLARE(ObjCLanguage)
-LLDB_PLUGIN_DECLARE(ObjCPlusPlusLanguage)
-#if defined(_WIN32)
-LLDB_PLUGIN_DECLARE(ProcessWindows)
-#endif
-#if defined(__FreeBSD__)
-LLDB_PLUGIN_DECLARE(ProcessFreeBSD)
-#endif
-#if defined(__APPLE__)
-LLDB_PLUGIN_DECLARE(SymbolVendorMacOSX)
-LLDB_PLUGIN_DECLARE(ProcessKDP)
-LLDB_PLUGIN_DECLARE(DynamicLoaderDarwinKernel)
-#endif
-LLDB_PLUGIN_DECLARE(StructuredDataDarwinLog)
-LLDB_PLUGIN_DECLARE(PlatformRemoteGDBServer)
-LLDB_PLUGIN_DECLARE(ProcessGDBRemote)
-LLDB_PLUGIN_DECLARE(DynamicLoaderMacOSXDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderPOSIXDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderStatic)
-LLDB_PLUGIN_DECLARE(DynamicLoaderWasmDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderWindowsDYLD)
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_DECLARE(p)
+#include "Plugins/Plugins.def"
 
 using namespace lldb_private;
 
@@ -114,144 +33,24 @@ SystemInitializerFull::SystemInitializerFull() {}
 
 SystemInitializerFull::~SystemInitializerFull() {}
 
-#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
-#define LLDB_PROCESS_ARM(op) op(ABIARM);
-#define LLDB_PROCESS_ARC(op) op(ABISysV_arc);
-#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon);
-#define LLDB_PROCESS_Mips(op) op(ABIMips);
-#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
-#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x);
-#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(ObjectFileMachO);
-  LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileWasm);
-
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerUniversalMachO);
-
-  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);
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
+#include "Plugins/Plugins.def"
 
-  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(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)
-  LLDB_PLUGIN_INITIALIZE(ProcessWindows);
-#endif
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD);
-#endif
-#if defined(__APPLE__)
-  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__.
-  LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog);
-
-  // Platform agnostic plugins
-  LLDB_PLUGIN_INITIALIZE(PlatformRemoteGDBServer);
-
-  LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderPOSIXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWasmDYLD); // Before DynamicLoaderStatic.
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWindowsDYLD);
-
-  // Scan for any system or user LLDB plug-ins
+  // 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();
@@ -263,106 +62,11 @@ void SystemInitializerFull::Terminate() {
 
   Debugger::SettingsTerminate();
 
-  // Terminate and unload and loaded system or user LLDB plug-ins
+  // 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(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(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__)
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_TERMINATE(ProcessKDP);
-  LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX);
-#endif
-
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_TERMINATE(ProcessFreeBSD);
-#endif
-  Debugger::SettingsTerminate();
-
-  LLDB_PLUGIN_TERMINATE(PlatformRemoteGDBServer);
-  LLDB_PLUGIN_TERMINATE(ProcessGDBRemote);
-  LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog);
-
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderPOSIXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderWasmDYLD);
-  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(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
-  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/ABI/AArch64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
index 94f7c2aff641..8ba63b9ba4a1 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
@@ -1665,7 +1665,7 @@ ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
   const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
 
   if (vendor_type == llvm::Triple::Apple) {
-    if (arch_type == llvm::Triple::aarch64 || 
+    if (arch_type == llvm::Triple::aarch64 ||
         arch_type == llvm::Triple::aarch64_32) {
       return ABISP(
           new ABIMacOSX_arm64(std::move(process_sp), MakeMCRegisterInfo(arch)));

diff  --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
index 1690f1c511f2..10e3b0ff2f7d 100644
--- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
+++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
@@ -55,7 +55,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ABISysV_arc)
+LLDB_PLUGIN_DEFINE_ADV(ABISysV_arc, ABIARC)
 
 namespace {
 namespace dwarf {
@@ -146,7 +146,7 @@ size_t ABISysV_arc::GetRedZoneSize() const { return 0; }
 bool ABISysV_arc::IsRegisterFileReduced(RegisterContext &reg_ctx) const {
   if (!m_is_reg_file_reduced) {
     const auto *const rf_build_reg = reg_ctx.GetRegisterInfoByName("rf_build");
-    
+
     const auto reg_value = reg_ctx.ReadRegisterAsUnsigned(rf_build_reg,
                                                           /*fail_value*/ 0);
     // RF_BUILD "Number of Entries" bit.
@@ -241,7 +241,7 @@ bool ABISysV_arc::PrepareTrivialCall(Thread &thread, addr_t sp, addr_t pc,
   // Make sure number of parameters matches prototype.
   assert(!prototype.isFunctionVarArg());
   assert(prototype.getFunctionNumParams() == args.size());
-  
+
   const size_t regs_for_args_count = IsRegisterFileReduced(*reg_ctx) ? 4U : 8U;
 
   // Number of arguments passed on stack.

diff  --git a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
index 73d8308ae0dc..ef500cb198a8 100644
--- a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
@@ -34,8 +34,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(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/Hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
index 601d9c2f0f05..32313d4cd815 100644
--- a/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
+++ b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
@@ -32,7 +32,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ABISysV_hexagon)
+LLDB_PLUGIN_DEFINE_ADV(ABISysV_hexagon, ABIHexagon)
 
 static RegisterInfo g_register_infos[] = {
     // hexagon-core.xml

diff  --git a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
index bfeaa1226df2..eced2adc7591 100644
--- a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
+++ b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
@@ -32,7 +32,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ABISysV_s390x)
+LLDB_PLUGIN_DEFINE_ADV(ABISysV_s390x, ABISystemZ)
 
 enum dwarf_regnums {
   // General Purpose Registers

diff  --git a/lldb/source/Plugins/CMakeLists.txt b/lldb/source/Plugins/CMakeLists.txt
index 08817baec14c..2ab29209810b 100644
--- a/lldb/source/Plugins/CMakeLists.txt
+++ b/lldb/source/Plugins/CMakeLists.txt
@@ -21,3 +21,30 @@ add_subdirectory(SystemRuntime)
 add_subdirectory(SymbolVendor)
 add_subdirectory(TypeSystem)
 add_subdirectory(UnwindAssembly)
+
+set(LLDB_STRIPPED_PLUGINS)
+get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
+
+set(LLDB_ENUM_PLUGINS "")
+
+# FIXME: This is a hack to make the DynamicLoaderWasmDYLD happy.
+set(LLDB_DYNAMIC_LOADER_STATIC "")
+
+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 "DynamicLoaderStatic")
+    set(LLDB_DYNAMIC_LOADER_STATIC "${LLDB_DYNAMIC_LOADER_STATIC}LLDB_PLUGIN(${pStripped})\n")
+  else()
+    set(LLDB_ENUM_PLUGINS "${LLDB_ENUM_PLUGINS}LLDB_PLUGIN(${pStripped})\n")
+  endif()
+endforeach(p)
+
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/Plugins.def.in
+  ${CMAKE_CURRENT_BINARY_DIR}/Plugins.def
+  )
+
+set_property(GLOBAL PROPERTY LLDB_PLUGINS_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR})

diff  --git a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
index a25a436d498e..51959cbbc993 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
+++ b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginDisassemblerLLVM PLUGIN
+add_lldb_library(lldbPluginDisassemblerLLVMC PLUGIN
   DisassemblerLLVMC.cpp
 
   LINK_LIBS

diff  --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
index 4e227abbafc2..fe86b2929073 100644
--- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
@@ -25,6 +25,8 @@
 using namespace lldb;
 using namespace lldb_private;
 
+LLDB_PLUGIN_DEFINE(DynamicLoaderHexagonDYLD)
+
 // Aidan 21/05/2014
 //
 // Notes about hexagon dynamic loading:

diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index c572c3024f9c..ac60af5336ed 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -29,7 +29,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(DynamicLoaderPOSIXDYLD)
+LLDB_PLUGIN_DEFINE_ADV(DynamicLoaderPOSIXDYLD, DynamicLoaderPosixDYLD)
 
 void DynamicLoaderPOSIXDYLD::Initialize() {
   PluginManager::RegisterPlugin(GetPluginNameStatic(),

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index 909e92ace8d4..0506bb6227ca 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -2,7 +2,7 @@ if(NOT LLDB_BUILT_STANDALONE)
   set(tablegen_deps intrinsics_gen)
 endif()
 
-add_lldb_library(lldbPluginExpressionParserClang PLUGIN
+add_lldb_library(lldbPluginExpressionParserClang 
   ASTResultSynthesizer.cpp
   ASTStructExtractor.cpp
   ASTUtils.cpp

diff  --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
index e87bc1f75f5c..aa99db418283 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -30,7 +30,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(EmulateInstructionARM)
+LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionARM, InstructionARM)
 
 // Convenient macro definitions.
 #define APSR_C Bit32(m_opcode_cpsr, CPSR_C_POS)

diff  --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
index 144d38373247..f58453909426 100644
--- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -47,7 +47,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(EmulateInstructionARM64)
+LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionARM64, InstructionARM64)
 
 static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo &reg_info) {
   if (reg_num >= llvm::array_lengthof(g_register_infos_arm64_le))

diff  --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index ae74c89c4f2e..61eb8912295f 100644
--- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -40,7 +40,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(EmulateInstructionMIPS)
+LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionMIPS, InstructionMIPS)
 
 #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
index 9a578ab408f7..b8305591749b 100644
--- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -40,7 +40,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(EmulateInstructionMIPS64)
+LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionMIPS64, InstructionMIPS64)
 
 #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
index 2588c935dd6b..1cab8fdd6e2a 100644
--- a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
+++ b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
@@ -25,7 +25,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(EmulateInstructionPPC64)
+LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionPPC64, InstructionPPC64)
 
 EmulateInstructionPPC64::EmulateInstructionPPC64(const ArchSpec &arch)
     : EmulateInstruction(arch) {}

diff  --git a/lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt b/lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt
index 854320dd312e..980d788afc72 100644
--- a/lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt
+++ b/lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginClangCommon PLUGIN
+add_lldb_library(lldbPluginClangCommon
   ClangHighlighter.cpp
 
   LINK_LIBS

diff  --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
index 508a361aa6dd..ebfa7c8c005c 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginCPPRuntime PLUGIN
+add_lldb_library(lldbPluginCPPRuntime 
   CPPLanguageRuntime.cpp
 
   LINK_LIBS

diff  --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index e08f0f070f6c..df2aaca8a943 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -40,7 +40,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ItaniumABILanguageRuntime)
+LLDB_PLUGIN_DEFINE_ADV(ItaniumABILanguageRuntime, CXXItaniumABI)
 
 static const char *vtable_demangled_prefix = "vtable for ";
 

diff  --git a/lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt b/lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
index 5b3ea2ff27fa..d6de9dcc31bc 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginObjCRuntime PLUGIN
+add_lldb_library(lldbPluginObjCRuntime
   ObjCLanguageRuntime.cpp
 
   LINK_LIBS

diff  --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index bc30e57d1d0c..bb56379ed1e4 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -20,7 +20,8 @@ using namespace lldb;
 using namespace lldb_private;
 using namespace llvm::MachO;
 
-LLDB_PLUGIN_DEFINE(ObjectContainerUniversalMachO)
+LLDB_PLUGIN_DEFINE_ADV(ObjectContainerUniversalMachO,
+                       ObjectContainerMachOArchive)
 
 void ObjectContainerUniversalMachO::Initialize() {
   PluginManager::RegisterPlugin(GetPluginNameStatic(),

diff  --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
index 2d505bcd409b..371bbb5ff84d 100644
--- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -39,6 +39,8 @@
 using namespace lldb;
 using namespace lldb_private;
 
+LLDB_PLUGIN_DEFINE(ObjectFileJIT)
+
 char ObjectFileJIT::ID;
 
 void ObjectFileJIT::Initialize() {

diff  --git a/lldb/source/Plugins/OperatingSystem/CMakeLists.txt b/lldb/source/Plugins/OperatingSystem/CMakeLists.txt
index 655007a0aab9..06d909b862a0 100644
--- a/lldb/source/Plugins/OperatingSystem/CMakeLists.txt
+++ b/lldb/source/Plugins/OperatingSystem/CMakeLists.txt
@@ -1 +1,3 @@
-add_subdirectory(Python)
+if (LLDB_ENABLE_PYTHON)
+  add_subdirectory(Python)
+endif()

diff  --git a/lldb/source/Plugins/Platform/POSIX/CMakeLists.txt b/lldb/source/Plugins/Platform/POSIX/CMakeLists.txt
index c4c62e46add3..106fe964ddb7 100644
--- a/lldb/source/Plugins/Platform/POSIX/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/POSIX/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginPlatformPOSIX PLUGIN
+add_lldb_library(lldbPluginPlatformPOSIX 
   PlatformPOSIX.cpp
 
    LINK_LIBS

diff  --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index 550b68090e7a..b0467555665c 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -35,7 +35,7 @@ using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_gdb_server;
 
-LLDB_PLUGIN_DEFINE(PlatformRemoteGDBServer)
+LLDB_PLUGIN_DEFINE_ADV(PlatformRemoteGDBServer, PlatformGDB)
 
 static bool g_initialized = false;
 

diff  --git a/lldb/source/Plugins/Plugins.def.in b/lldb/source/Plugins/Plugins.def.in
new file mode 100644
index 000000000000..98977fc62d2a
--- /dev/null
+++ b/lldb/source/Plugins/Plugins.def.in
@@ -0,0 +1,36 @@
+/*===- lldb/source/Plugin/Plugins.def ---------------------------*- C++ -*-===*\
+|*                                                                            *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
+|* Exceptions.                                                                *|
+|* See https://llvm.org/LICENSE.txt for license information.                  *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
+|*                                                                            *|
+|*===----------------------------------------------------------------------===*|
+|*                                                                            *|
+|* This file enumerates all of the plugins supported by this build of LLDB.   *|
+|* Clients of this file should define the LLDB_PLUGIN macro to be a           *|
+|* function-like macro with a single parameter (the name of the plugin)       *|
+|* including this file will then enumerate all of the plugins. Script         *|
+|* interpreter plugins can be enumerated separately by defining               *|
+|* LLDB_SCRIPT_PLUGIN in which case they are not part of LLDB_PLUGIN.         *|
+|*                                                                            *|
+|*                                                                            *|
+|* The set of plugins supported by LLDB is generated at configuration         *|
+|* time, at which point this header is generated. Do not modify this          *|
+|* header directly.                                                           *|
+|*                                                                            *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef LLDB_PLUGIN
+#  error Please define the macro LLDB_PLUGIN(PluginName)
+#endif
+
+#ifndef LLDB_SCRIPT_PLUGIN
+#define LLDB_SCRIPT_PLUGIN(p) LLDB_PLUGIN(p)
+#endif
+
+ at LLDB_ENUM_PLUGINS@
+ at LLDB_DYNAMIC_LOADER_STATIC@
+
+#undef LLDB_PLUGIN
+#undef LLDB_SCRIPT_PLUGIN

diff  --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index e78912e3cd30..09d1965f25ed 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -50,7 +50,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ProcessKDP)
+LLDB_PLUGIN_DEFINE_ADV(ProcessKDP, ProcessMacOSXKernel)
 
 namespace {
 

diff  --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 55746b04c39f..dfc8c11f3869 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginProcessUtility PLUGIN
+add_lldb_library(lldbPluginProcessUtility
   AuxVector.cpp
   DynamicRegisterInfo.cpp
   FreeBSDSignals.cpp

diff  --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 286a95fa5894..7b020f55e993 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -44,7 +44,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(ProcessWindows)
+LLDB_PLUGIN_DEFINE_ADV(ProcessWindows, ProcessWindowsCommon)
 
 namespace {
 std::string GetProcessExecutableName(HANDLE process_handle) {

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index 73dec53eda6a..e6819096f994 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -66,6 +66,8 @@ using namespace npdb;
 using namespace llvm::codeview;
 using namespace llvm::pdb;
 
+LLDB_PLUGIN_DEFINE(SymbolFileNativePDB)
+
 char SymbolFileNativePDB::ID;
 
 static lldb::LanguageType TranslateLanguage(PDB_Lang lang) {

diff  --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
index 430ba09b811c..dc62e957c1a1 100644
--- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
@@ -30,7 +30,7 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN_DEFINE(UnwindAssembly_x86)
+LLDB_PLUGIN_DEFINE_ADV(UnwindAssembly_x86, UnwindAssemblyX86)
 
 //  UnwindAssemblyParser_x86 method definitions
 

diff  --git a/lldb/tools/lldb-test/CMakeLists.txt b/lldb/tools/lldb-test/CMakeLists.txt
index 2ab1ceacdcd1..f3530fd7b859 100644
--- a/lldb/tools/lldb-test/CMakeLists.txt
+++ b/lldb/tools/lldb-test/CMakeLists.txt
@@ -23,5 +23,6 @@ add_lldb_tool(lldb-test
   LINK_COMPONENTS
     Support
   )
-  
-include_directories(${LLDB_SOURCE_DIR}/source)
+
+target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source)
+target_include_directories(lldb-test PRIVATE ${LLDB_BINARY_DIR}/source)

diff  --git a/lldb/tools/lldb-test/SystemInitializerTest.cpp b/lldb/tools/lldb-test/SystemInitializerTest.cpp
index b33b08640471..cd180b5f2387 100644
--- a/lldb/tools/lldb-test/SystemInitializerTest.cpp
+++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp
@@ -17,82 +17,10 @@
 
 #include <string>
 
-LLDB_PLUGIN_DECLARE(ABIAArch64);
-LLDB_PLUGIN_DECLARE(ABIARM);
-LLDB_PLUGIN_DECLARE(ABISysV_arc);
-LLDB_PLUGIN_DECLARE(ABISysV_hexagon);
-LLDB_PLUGIN_DECLARE(ABIMips);
-LLDB_PLUGIN_DECLARE(ABIPowerPC);
-LLDB_PLUGIN_DECLARE(ABISysV_s390x);
-LLDB_PLUGIN_DECLARE(ABIX86);
-LLDB_PLUGIN_DECLARE(ObjectFileBreakpad)
-LLDB_PLUGIN_DECLARE(ObjectFileELF)
-LLDB_PLUGIN_DECLARE(ObjectFileMachO)
-LLDB_PLUGIN_DECLARE(ObjectFilePECOFF)
-LLDB_PLUGIN_DECLARE(ObjectFileWasm)
-LLDB_PLUGIN_DECLARE(ObjectContainerBSDArchive)
-LLDB_PLUGIN_DECLARE(ObjectContainerUniversalMachO)
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_DECLARE(p)
+#include "Plugins/Plugins.def"
+
 LLDB_PLUGIN_DECLARE(ScriptInterpreterNone)
-LLDB_PLUGIN_DECLARE(PlatformFreeBSD)
-LLDB_PLUGIN_DECLARE(PlatformLinux)
-LLDB_PLUGIN_DECLARE(PlatformNetBSD)
-LLDB_PLUGIN_DECLARE(PlatformOpenBSD)
-LLDB_PLUGIN_DECLARE(PlatformWindows)
-LLDB_PLUGIN_DECLARE(PlatformAndroid)
-LLDB_PLUGIN_DECLARE(PlatformMacOSX)
-LLDB_PLUGIN_DECLARE(TypeSystemClang)
-LLDB_PLUGIN_DECLARE(ArchitectureArm)
-LLDB_PLUGIN_DECLARE(ArchitectureMips)
-LLDB_PLUGIN_DECLARE(ArchitecturePPC64)
-LLDB_PLUGIN_DECLARE(DisassemblerLLVMC)
-LLDB_PLUGIN_DECLARE(JITLoaderGDB)
-LLDB_PLUGIN_DECLARE(ProcessElfCore)
-LLDB_PLUGIN_DECLARE(ProcessMachCore)
-LLDB_PLUGIN_DECLARE(ProcessMinidump)
-LLDB_PLUGIN_DECLARE(MemoryHistoryASan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeASan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeTSan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeUBSan)
-LLDB_PLUGIN_DECLARE(InstrumentationRuntimeMainThreadChecker)
-LLDB_PLUGIN_DECLARE(SymbolVendorELF)
-LLDB_PLUGIN_DECLARE(SymbolFileBreakpad)
-LLDB_PLUGIN_DECLARE(SymbolFileDWARF)
-LLDB_PLUGIN_DECLARE(SymbolFilePDB)
-LLDB_PLUGIN_DECLARE(SymbolFileSymtab)
-LLDB_PLUGIN_DECLARE(SymbolVendorWasm)
-LLDB_PLUGIN_DECLARE(UnwindAssemblyInstEmulation)
-LLDB_PLUGIN_DECLARE(UnwindAssembly_x86)
-LLDB_PLUGIN_DECLARE(EmulateInstructionARM)
-LLDB_PLUGIN_DECLARE(EmulateInstructionARM64)
-LLDB_PLUGIN_DECLARE(EmulateInstructionMIPS)
-LLDB_PLUGIN_DECLARE(EmulateInstructionMIPS64)
-LLDB_PLUGIN_DECLARE(EmulateInstructionPPC64)
-LLDB_PLUGIN_DECLARE(ItaniumABILanguageRuntime)
-LLDB_PLUGIN_DECLARE(AppleObjCRuntime)
-LLDB_PLUGIN_DECLARE(SystemRuntimeMacOSX)
-LLDB_PLUGIN_DECLARE(RenderScriptRuntime)
-LLDB_PLUGIN_DECLARE(CPlusPlusLanguage)
-LLDB_PLUGIN_DECLARE(ObjCLanguage)
-LLDB_PLUGIN_DECLARE(ObjCPlusPlusLanguage)
-#if defined(_WIN32)
-LLDB_PLUGIN_DECLARE(ProcessWindows)
-#endif
-#if defined(__FreeBSD__)
-LLDB_PLUGIN_DECLARE(ProcessFreeBSD)
-#endif
-#if defined(__APPLE__)
-LLDB_PLUGIN_DECLARE(SymbolVendorMacOSX)
-LLDB_PLUGIN_DECLARE(ProcessKDP)
-LLDB_PLUGIN_DECLARE(DynamicLoaderDarwinKernel)
-#endif
-LLDB_PLUGIN_DECLARE(StructuredDataDarwinLog)
-LLDB_PLUGIN_DECLARE(PlatformRemoteGDBServer)
-LLDB_PLUGIN_DECLARE(ProcessGDBRemote)
-LLDB_PLUGIN_DECLARE(DynamicLoaderMacOSXDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderPOSIXDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderStatic)
-LLDB_PLUGIN_DECLARE(DynamicLoaderWasmDYLD)
-LLDB_PLUGIN_DECLARE(DynamicLoaderWindowsDYLD)
 
 using namespace lldb_private;
 
@@ -100,133 +28,29 @@ SystemInitializerTest::SystemInitializerTest() {}
 
 SystemInitializerTest::~SystemInitializerTest() {}
 
-#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
-#define LLDB_PROCESS_ARM(op) op(ABIARM);
-#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon);
-#define LLDB_PROCESS_Mips(op) op(ABIMips);
-#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
-#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x);
-#define LLDB_PROCESS_X86(op) op(ABIX86);
-
-#define LLDB_PROCESS_AMDGPU(op)
-#define LLDB_PROCESS_ARC(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 SystemInitializerTest::Initialize() {
   if (auto e = SystemInitializerCommon::Initialize())
     return e;
 
-  LLDB_PLUGIN_INITIALIZE(ObjectFileBreakpad);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileELF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileMachO);
-  LLDB_PLUGIN_INITIALIZE(ObjectFilePECOFF);
-  LLDB_PLUGIN_INITIALIZE(ObjectFileWasm);
-
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerBSDArchive);
-  LLDB_PLUGIN_INITIALIZE(ObjectContainerUniversalMachO);
-
-  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);
+#define LLDB_SCRIPT_PLUGIN(p)
+#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
+#include "Plugins/Plugins.def"
 
-  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(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)
-  LLDB_PLUGIN_INITIALIZE(ProcessWindows);
-#endif
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_INITIALIZE(ProcessFreeBSD);
-#endif
-#if defined(__APPLE__)
-  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__.
-  LLDB_PLUGIN_INITIALIZE(StructuredDataDarwinLog);
-
-  // Platform agnostic plugins
-  LLDB_PLUGIN_INITIALIZE(PlatformRemoteGDBServer);
-
-  LLDB_PLUGIN_INITIALIZE(ProcessGDBRemote);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderPOSIXDYLD);
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderWasmDYLD); // Before DynamicLoaderStatic.
-  LLDB_PLUGIN_INITIALIZE(DynamicLoaderStatic);
-  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
+  // 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();
@@ -238,95 +62,17 @@ void SystemInitializerTest::Terminate() {
 
   Debugger::SettingsTerminate();
 
-  // Terminate and unload and loaded system or user LLDB plug-ins
+  // 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(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(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__)
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderDarwinKernel);
-  LLDB_PLUGIN_TERMINATE(ProcessKDP);
-  LLDB_PLUGIN_TERMINATE(SymbolVendorMacOSX);
-#endif
-
-#if defined(__FreeBSD__)
-  LLDB_PLUGIN_TERMINATE(ProcessFreeBSD);
-#endif
-  Debugger::SettingsTerminate();
-
-  LLDB_PLUGIN_TERMINATE(PlatformRemoteGDBServer);
-  LLDB_PLUGIN_TERMINATE(ProcessGDBRemote);
-  LLDB_PLUGIN_TERMINATE(StructuredDataDarwinLog);
-
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderMacOSXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderPOSIXDYLD);
-  LLDB_PLUGIN_TERMINATE(DynamicLoaderWasmDYLD);
-  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(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);
-
+  // We ignored all the script interpreter earlier, so terminate
+  // ScriptInterpreterNone explicitly.
   LLDB_PLUGIN_TERMINATE(ScriptInterpreterNone);
 
+#define LLDB_SCRIPT_PLUGIN(p)
+#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/unittests/Disassembler/CMakeLists.txt b/lldb/unittests/Disassembler/CMakeLists.txt
index de78d12fa2fa..a0a3c264f16c 100644
--- a/lldb/unittests/Disassembler/CMakeLists.txt
+++ b/lldb/unittests/Disassembler/CMakeLists.txt
@@ -6,7 +6,7 @@ if("ARM" IN_LIST LLVM_TARGETS_TO_BUILD)
       lldbCore
       lldbSymbol
       lldbTarget
-      lldbPluginDisassemblerLLVM
+      lldbPluginDisassemblerLLVMC
       lldbPluginProcessUtility
     LINK_COMPONENTS
       Support

diff  --git a/lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt b/lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
index 77924792fe5c..f3bbd71df32d 100644
--- a/lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
+++ b/lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
@@ -5,7 +5,7 @@ add_lldb_unittest(Arm64InstEmulationTests
     lldbSymbol
     lldbTarget
     lldbPluginUnwindAssemblyInstEmulation
-    lldbPluginDisassemblerLLVM
+    lldbPluginDisassemblerLLVMC
     lldbPluginInstructionARM64
     lldbPluginProcessUtility
   LINK_COMPONENTS

diff  --git a/lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt b/lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt
index d803f4593636..679f7664cb87 100644
--- a/lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt
+++ b/lldb/unittests/UnwindAssembly/PPC64/CMakeLists.txt
@@ -5,7 +5,7 @@ add_lldb_unittest(PPC64InstEmulationTests
     lldbSymbol
     lldbTarget
     lldbPluginUnwindAssemblyInstEmulation
-    lldbPluginDisassemblerLLVM
+    lldbPluginDisassemblerLLVMC
     lldbPluginInstructionPPC64
     lldbPluginProcessUtility
   LINK_COMPONENTS


        


More information about the lldb-commits mailing list