JDevlieghere created this revision.
JDevlieghere added reviewers: labath, xiaobai, teemperor, compnerd.
Herald added subscribers: s.egerton, jsji, abidh, atanasyan, simoncook, 
fedor.sergeev, kbarton, aheejin, krytarowski, mgorny, nemanjai, dschuff.
Herald added a project: LLDB.
JDevlieghere added a child revision: D73016: [lldb/CMake] Make it possible to 
disable plugins at configuration time.
Herald added a subscriber: wuzish.
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.


================
Comment at: lldb/source/API/SystemInitializerFull.cpp:136
+// Some of the plugins have their own namespace.
+using namespace lldb_private::breakpad;
+using namespace clang;
----------------
I used the namespaces to limit the churn, but I would prefer to just remove 
them altogether form the plugins, or at least have the main entry point live 
under `lldb_private`. 


This patch changes the way we initialize and terminate the plugins in the 
system initializer. It uses a similar approach as LLVM's TARGETS_TO_BUILD with 
a def file that enumerates the configured plugins. To make this work I had to 
rename some of the plugins. I went for the solution with the least churn, but 
we should probably clean this up in the future as separate patches.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D73067

Files:
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Plugins/CMakeLists.txt
  lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
  lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
  lldb/source/Plugins/Instruction/ARM/CMakeLists.txt
  lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt
  lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt
  lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt
  lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
  lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
  lldb/source/Plugins/Language/ClangCommon/ClangCommon.h
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
  lldb/source/Plugins/ObjectContainer/Universal-Mach-O/CMakeLists.txt
  lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt
  lldb/source/Plugins/Platform/Android/CMakeLists.txt
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt
  lldb/source/Plugins/Plugins.def.in
  lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
  lldb/source/Plugins/Process/Utility/ProcessUtility.h
  lldb/source/Plugins/Process/elf-core/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt
  lldb/source/Symbol/CMakeLists.txt
  lldb/source/Target/CMakeLists.txt
  lldb/tools/lldb-server/CMakeLists.txt
  lldb/unittests/Expression/CMakeLists.txt
  lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt

Index: lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
===================================================================
--- lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
+++ lldb/unittests/UnwindAssembly/ARM64/CMakeLists.txt
@@ -6,7 +6,7 @@
     lldbTarget
     lldbPluginUnwindAssemblyInstEmulation
     lldbPluginDisassemblerLLVM
-    lldbPluginInstructionARM64
+    lldbPluginEmulateInstructionARM64
     lldbPluginProcessUtility
   LINK_COMPONENTS
     Support
Index: lldb/unittests/Expression/CMakeLists.txt
===================================================================
--- lldb/unittests/Expression/CMakeLists.txt
+++ lldb/unittests/Expression/CMakeLists.txt
@@ -7,7 +7,7 @@
 
   LINK_LIBS
     lldbCore
-    lldbPluginExpressionParserClang
+    lldbPluginClangASTContext
     lldbUtility
     lldbUtilityHelpers
     LLVMTestingSupport
Index: lldb/tools/lldb-server/CMakeLists.txt
===================================================================
--- lldb/tools/lldb-server/CMakeLists.txt
+++ lldb/tools/lldb-server/CMakeLists.txt
@@ -41,9 +41,9 @@
       lldbHost
       lldbInitialization
       ${LLDB_PLUGINS}
-      lldbPluginInstructionARM
-      lldbPluginInstructionMIPS
-      lldbPluginInstructionMIPS64
+      lldbPluginEmulateInstructionARM
+      lldbPluginEmulateInstructionMIPS
+      lldbPluginEmulateInstructionMIPS64
       ${LLDB_SYSTEM_LIBS}
 
     LINK_COMPONENTS
Index: lldb/source/Target/CMakeLists.txt
===================================================================
--- lldb/source/Target/CMakeLists.txt
+++ lldb/source/Target/CMakeLists.txt
@@ -73,7 +73,7 @@
     lldbInterpreter
     lldbSymbol
     lldbUtility
-    lldbPluginExpressionParserClang
+    lldbPluginClangASTContext
     lldbPluginProcessUtility
 
   LINK_COMPONENTS
Index: lldb/source/Symbol/CMakeLists.txt
===================================================================
--- lldb/source/Symbol/CMakeLists.txt
+++ lldb/source/Symbol/CMakeLists.txt
@@ -51,11 +51,11 @@
     lldbHost
     lldbTarget
     lldbUtility
-    lldbPluginExpressionParserClang
+    lldbPluginClangASTContext
     lldbPluginSymbolFileDWARF
     lldbPluginSymbolFilePDB
     lldbPluginObjCLanguage
-    lldbPluginObjCRuntime
+    lldbPluginObjCLanguageRuntime
 
   CLANG_LIBS
     clangAST
Index: lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt
+++ lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginUnwindAssemblyX86 PLUGIN
+add_lldb_library(lldbPluginUnwindAssembly_x86 PLUGIN
   UnwindAssembly-x86.cpp
   x86AssemblyInspectionEngine.cpp
 
Index: lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -52,7 +52,7 @@
     lldbUtility
     lldbPluginObjCLanguage
     lldbPluginCPlusPlusLanguage
-    lldbPluginExpressionParserClang
+    lldbPluginClangASTContext
   CLANG_LIBS
     clangAST
     clangBasic
Index: lldb/source/Plugins/Process/elf-core/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Process/elf-core/CMakeLists.txt
+++ lldb/source/Plugins/Process/elf-core/CMakeLists.txt
@@ -13,7 +13,7 @@
   LINK_LIBS
     lldbCore
     lldbTarget
-    lldbPluginDynamicLoaderPosixDYLD
+    lldbPluginDynamicLoaderPOSIXDYLD
     lldbPluginObjectFileELF
     lldbPluginProcessUtility
   LINK_COMPONENTS
Index: lldb/source/Plugins/Process/Utility/ProcessUtility.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/ProcessUtility.h
@@ -0,0 +1,20 @@
+//===-- ProcessUtility.h -------------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ProcessUtility_h_
+
+namespace lldb_private {
+class ProcessUtility {
+public:
+  static void Initialize() {}
+  static void Terminate() {}
+};
+} // namespace lldb_private
+
+#endif
Index: lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
+++ lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
@@ -6,7 +6,7 @@
   SOURCE ProcessKDPProperties.td
   TARGET LLDBPluginProcessMacOSXKernelPropertiesEnumGen)
 
-add_lldb_library(lldbPluginProcessMacOSXKernel PLUGIN
+add_lldb_library(lldbPluginProcessKDP PLUGIN
   CommunicationKDP.cpp
   ProcessKDP.cpp
   ProcessKDPLog.cpp
@@ -29,6 +29,6 @@
     lldbPluginProcessUtility
   )
 
-add_dependencies(lldbPluginProcessMacOSXKernel
+add_dependencies(lldbPluginProcessKDP
   LLDBPluginProcessMacOSXKernelPropertiesGen
   LLDBPluginProcessMacOSXKernelPropertiesEnumGen)
Index: lldb/source/Plugins/Plugins.def.in
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Plugins.def.in
@@ -0,0 +1,27 @@
+/*===- 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 targets.                *|
+|*                                                                            *|
+|* 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
+
+@LLDB_ENUM_PLUGINS@
+
+#undef LLDB_PLUGIN
Index: lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt
+++ lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginPlatformGDB PLUGIN
+add_lldb_library(lldbPluginPlatformRemoteGDBServer PLUGIN
   PlatformRemoteGDBServer.cpp
 
    LINK_LIBS
Index: lldb/source/Plugins/Platform/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Platform/CMakeLists.txt
+++ lldb/source/Plugins/Platform/CMakeLists.txt
@@ -1,17 +1,16 @@
-#if (CMAKE_SYSTEM_NAME MATCHES "Linux")
-  add_subdirectory(Linux)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   add_subdirectory(FreeBSD)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   add_subdirectory(NetBSD)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
   add_subdirectory(OpenBSD)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX)
-#elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
+elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows)
-#endif()
+endif()
 
+add_subdirectory(Linux)
 add_subdirectory(POSIX)
 add_subdirectory(gdb-server)
 add_subdirectory(Android)
Index: lldb/source/Plugins/Platform/Android/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Platform/Android/CMakeLists.txt
+++ lldb/source/Plugins/Platform/Android/CMakeLists.txt
@@ -7,7 +7,7 @@
     lldbCore
     lldbHost
     lldbPluginPlatformLinux
-    lldbPluginPlatformGDB
+    lldbPluginPlatformRemoteGDBServer
   LINK_COMPONENTS
     Support
   )
Index: lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt
+++ lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginOSPython PLUGIN
+add_lldb_library(lldbPluginOperatingSystemPython PLUGIN
   OperatingSystemPython.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/ObjectContainer/Universal-Mach-O/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ObjectContainer/Universal-Mach-O/CMakeLists.txt
+++ lldb/source/Plugins/ObjectContainer/Universal-Mach-O/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginObjectContainerMachOArchive PLUGIN
+add_lldb_library(lldbPluginObjectContainerUniversalMachO PLUGIN
   ObjectContainerUniversalMachO.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
+++ lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
@@ -44,6 +44,9 @@
   class ClassDescriptor;
   typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP;
 
+  static void Initialize() {}
+  static void Terminate() {}
+
   // the information that we want to support retrieving from an ObjC class this
   // needs to be pure virtual since there are at least 2 different
   // implementations of the runtime, and more might come
Index: lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginObjCRuntime PLUGIN
+add_lldb_library(lldbPluginObjCLanguageRuntime PLUGIN
   ObjCLanguageRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
@@ -17,8 +17,8 @@
     lldbSymbol
     lldbTarget
     lldbUtility
-    lldbPluginExpressionParserClang
-    lldbPluginCPPRuntime
+    lldbPluginClangASTContext
+    lldbPluginCPPLanguageRuntime
   CLANG_LIBS
     clangAST
   LINK_COMPONENTS
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
@@ -31,6 +31,10 @@
 
   static char ID;
 
+  static void Initialize();
+
+  static void Terminate();
+
   bool isA(const void *ClassID) const override {
     return ClassID == &ID || ObjCLanguageRuntime::isA(ClassID);
   }
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "AppleObjCRuntime.h"
+#include "AppleObjCRuntimeV1.h"
+#include "AppleObjCRuntimeV2.h"
 #include "AppleObjCTrampolineHandler.h"
 
 #include "clang/AST/Type.h"
@@ -55,6 +57,16 @@
   ReadObjCLibraryIfNeeded(process->GetTarget().GetImages());
 }
 
+void AppleObjCRuntime::Initialize() {
+  AppleObjCRuntimeV2::Initialize();
+  AppleObjCRuntimeV1::Initialize();
+}
+
+void AppleObjCRuntime::Terminate() {
+  AppleObjCRuntimeV2::Terminate();
+  AppleObjCRuntimeV1::Terminate();
+}
+
 bool AppleObjCRuntime::GetObjectDescription(Stream &str, ValueObject &valobj) {
   CompilerType compiler_type(valobj.GetCompilerType());
   bool is_signed;
Index: lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginCXXItaniumABI PLUGIN
+add_lldb_library(lldbPluginItaniumABILanguageRuntime PLUGIN
   ItaniumABILanguageRuntime.cpp
 
   LINK_LIBS
@@ -7,5 +7,5 @@
     lldbInterpreter
     lldbSymbol
     lldbTarget
-    lldbPluginCPPRuntime
+    lldbPluginCPPLanguageRuntime
   )
Index: lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
===================================================================
--- lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
+++ lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h
@@ -44,6 +44,9 @@
 
   static char ID;
 
+  static void Initialize() {}
+  static void Terminate() {}
+
   bool isA(const void *ClassID) const override {
     return ClassID == &ID || LanguageRuntime::isA(ClassID);
   }
Index: lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginCPPRuntime PLUGIN
+add_lldb_library(lldbPluginCPPLanguageRuntime PLUGIN
   CPPLanguageRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Language/ClangCommon/ClangCommon.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Language/ClangCommon/ClangCommon.h
@@ -0,0 +1,19 @@
+//===-- ClangCommon.h -------------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ClangCommon_h_
+
+namespace lldb_private {
+class ClangCommon {
+public:
+  static void Initialize() {}
+  static void Terminate() {}
+};
+} // namespace lldb_private
+
+#endif
Index: lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
+++ lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt
@@ -28,7 +28,7 @@
     lldbTarget
     lldbUtility
     lldbPluginClangCommon
-    lldbPluginCPPRuntime
+    lldbPluginCPPLanguageRuntime
 
   LINK_COMPONENTS
     Support
Index: lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
+++ lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeUBSan PLUGIN
+add_lldb_library(lldbPluginUndefinedBehaviorSanitizerRuntime PLUGIN
   UBSanRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
+++ lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeTSan PLUGIN
+add_lldb_library(lldbPluginThreadSanitizerRuntime PLUGIN
   TSanRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt
+++ lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeMainThreadChecker PLUGIN
+add_lldb_library(lldbPluginMainThreadCheckerRuntime PLUGIN
   MainThreadCheckerRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
+++ lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeASan PLUGIN
+add_lldb_library(lldbPluginAddressSanitizerRuntime PLUGIN
   ASanRuntime.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt
+++ lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstructionPPC64 PLUGIN
+add_lldb_library(lldbPluginEmulateInstructionPPC64 PLUGIN
   EmulateInstructionPPC64.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt
+++ lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt
@@ -2,7 +2,7 @@
   set(mips_target Mips)
 endif()
 
-add_lldb_library(lldbPluginInstructionMIPS64 PLUGIN
+add_lldb_library(lldbPluginEmulateInstructionMIPS64 PLUGIN
   EmulateInstructionMIPS64.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt
+++ lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt
@@ -2,7 +2,7 @@
   set(mips_target Mips)
 endif()
 
-add_lldb_library(lldbPluginInstructionMIPS PLUGIN
+add_lldb_library(lldbPluginEmulateInstructionMIPS PLUGIN
   EmulateInstructionMIPS.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt
+++ lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstructionARM64 PLUGIN
+add_lldb_library(lldbPluginEmulateInstructionARM64 PLUGIN
   EmulateInstructionARM64.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/Instruction/ARM/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Instruction/ARM/CMakeLists.txt
+++ lldb/source/Plugins/Instruction/ARM/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginInstructionARM PLUGIN
+add_lldb_library(lldbPluginEmulateInstructionARM PLUGIN
   EmulateInstructionARM.cpp
   EmulationStateARM.cpp
 
Index: lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -2,7 +2,7 @@
   set(tablegen_deps intrinsics_gen)
 endif()
 
-add_lldb_library(lldbPluginExpressionParserClang PLUGIN
+add_lldb_library(lldbPluginClangASTContext PLUGIN
   ASTResultSynthesizer.cpp
   ASTStructExtractor.cpp
   ASTUtils.cpp
@@ -34,7 +34,7 @@
     lldbTarget
     lldbUtility
     lldbPluginCPlusPlusLanguage
-    lldbPluginCPPRuntime
+    lldbPluginCPPLanguageRuntime
   CLANG_LIBS
     clangAST
     clangCodeGen
Index: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
+++ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginDynamicLoaderPosixDYLD PLUGIN
+add_lldb_library(lldbPluginDynamicLoaderPOSIXDYLD PLUGIN
   DYLDRendezvous.cpp
   DynamicLoaderPOSIXDYLD.cpp
 
Index: lldb/source/Plugins/DynamicLoader/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/DynamicLoader/CMakeLists.txt
+++ lldb/source/Plugins/DynamicLoader/CMakeLists.txt
@@ -1,6 +1,9 @@
-add_subdirectory(Darwin-Kernel)
-add_subdirectory(MacOSX-DYLD)
 add_subdirectory(POSIX-DYLD)
 add_subdirectory(Static)
 add_subdirectory(Hexagon-DYLD)
 add_subdirectory(Windows-DYLD)
+
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  add_subdirectory(Darwin-Kernel)
+  add_subdirectory(MacOSX-DYLD)
+endif()
Index: lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt
+++ lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginDisassemblerLLVM PLUGIN
+add_lldb_library(lldbPluginDisassemblerLLVMC PLUGIN
   DisassemblerLLVMC.cpp
 
   LINK_LIBS
Index: lldb/source/Plugins/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/CMakeLists.txt
+++ lldb/source/Plugins/CMakeLists.txt
@@ -20,3 +20,17 @@
 add_subdirectory(SystemRuntime)
 add_subdirectory(SymbolVendor)
 add_subdirectory(UnwindAssembly)
+
+
+set(LLDB_ENUM_PLUGINS "")
+get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
+foreach(p ${LLDB_ALL_PLUGINS})
+  # Strip lldbPlugin form the plugin name.
+  string(SUBSTRING ${p} 10 -1 pStripped)
+  set(LLDB_ENUM_PLUGINS "${LLDB_ENUM_PLUGINS}LLDB_PLUGIN(${pStripped})\n")
+endforeach(p)
+
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/Plugins.def.in
+  ${CMAKE_CURRENT_BINARY_DIR}/Plugins.def
+  )
Index: lldb/source/API/SystemInitializerFull.cpp
===================================================================
--- lldb/source/API/SystemInitializerFull.cpp
+++ lldb/source/API/SystemInitializerFull.cpp
@@ -44,6 +44,8 @@
 #include "Plugins/Architecture/Mips/ArchitectureMips.h"
 #include "Plugins/Architecture/PPC64/ArchitecturePPC64.h"
 #include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
+#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
+#include "Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h"
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h"
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
@@ -60,8 +62,10 @@
 #include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
 #include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
 #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
+#include "Plugins/Language/ClangCommon/ClangCommon.h"
 #include "Plugins/Language/ObjC/ObjCLanguage.h"
 #include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h"
+#include "Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h"
 #include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
@@ -71,6 +75,7 @@
 #include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
 #include "Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h"
 #include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "Plugins/ObjectFile/JIT/ObjectFileJIT.h"
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
 #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
 #include "Plugins/ObjectFile/wasm/ObjectFileWasm.h"
@@ -78,46 +83,41 @@
 #include "Plugins/Platform/Android/PlatformAndroid.h"
 #include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
 #include "Plugins/Platform/Linux/PlatformLinux.h"
+#include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h"
+#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h"
+#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
 #include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
 #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
+#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.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/FreeBSD/ProcessFreeBSD.h"
+#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h"
+#include "Plugins/Process/Utility/ProcessUtility.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/StructuredData/DarwinLog/StructuredDataDarwinLog.h"
 #include "Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h"
 #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
 #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h"
+#include "Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h"
 #include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
 #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
 #include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h"
+#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
 #include "Plugins/SymbolVendor/wasm/SymbolVendorWasm.h"
 #include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.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/Platform/MacOSX/PlatformAppleTVSimulator.h"
-#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h"
-#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
-#include "Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h"
-#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h"
-#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
-#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.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"
@@ -132,168 +132,38 @@
 
 #include <string>
 
+// Some of the plugins have their own namespace.
+using namespace lldb_private::breakpad;
+using namespace clang;
 using namespace lldb_private;
+using namespace platform_android;
+using namespace platform_freebsd;
+using namespace platform_gdb_server;
+using namespace platform_linux;
+using namespace platform_netbsd;
+using namespace platform_openbsd;
+using namespace wasm;
+using namespace process_gdb_remote;
+using namespace minidump;
+using namespace npdb;
 
 SystemInitializerFull::SystemInitializerFull() {}
 
 SystemInitializerFull::~SystemInitializerFull() {}
 
-#define LLDB_PROCESS_AArch64(op)                                               \
-  ABIMacOSX_arm64::op();                                                       \
-  ABISysV_arm64::op();
-#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();
-#define LLDB_PROCESS_Mips(op)                                                  \
-  ABISysV_mips::op();                                                          \
-  ABISysV_mips64::op();
-#define LLDB_PROCESS_PowerPC(op)                                               \
-  ABISysV_ppc::op();                                                          \
-  ABISysV_ppc64::op();
-#define LLDB_PROCESS_SystemZ(op) ABISysV_s390x::op();
-#define LLDB_PROCESS_X86(op)                                                   \
-  ABIMacOSX_i386::op();                                                        \
-  ABISysV_i386::op();                                                          \
-  ABISysV_x86_64::op();                                                        \
-  ABIWindows_x86_64::op();
-
-#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;
 
-  breakpad::ObjectFileBreakpad::Initialize();
-  ObjectFileELF::Initialize();
-  ObjectFileMachO::Initialize();
-  ObjectFilePECOFF::Initialize();
-  wasm::ObjectFileWasm::Initialize();
-
-  ObjectContainerBSDArchive::Initialize();
-  ObjectContainerUniversalMachO::Initialize();
-
-  ScriptInterpreterNone::Initialize();
-
-#if LLDB_ENABLE_PYTHON
-  OperatingSystemPython::Initialize();
-#endif
-
-#if LLDB_ENABLE_PYTHON
-  ScriptInterpreterPython::Initialize();
-#endif
-
-#if LLDB_ENABLE_LUA
-  ScriptInterpreterLua::Initialize();
-#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();
-#if defined(__APPLE__)
-  PlatformiOSSimulator::Initialize();
-  PlatformDarwinKernel::Initialize();
-#endif
-
-  // Initialize LLVM and Clang
+  // Initialize LLVM
   llvm::InitializeAllTargets();
   llvm::InitializeAllAsmPrinters();
   llvm::InitializeAllTargetMCs();
   llvm::InitializeAllDisassemblers();
 
-  ClangASTContext::Initialize();
-
-#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(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();
-  AddressSanitizerRuntime::Initialize();
-  ThreadSanitizerRuntime::Initialize();
-  UndefinedBehaviorSanitizerRuntime::Initialize();
-  MainThreadCheckerRuntime::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();
-  AppleObjCRuntimeV2::Initialize();
-  AppleObjCRuntimeV1::Initialize();
-  SystemRuntimeMacOSX::Initialize();
-  RenderScriptRuntime::Initialize();
-
-  CPlusPlusLanguage::Initialize();
-  ObjCLanguage::Initialize();
-  ObjCPlusPlusLanguage::Initialize();
-
-#if defined(_WIN32)
-  ProcessWindows::Initialize();
-#endif
-#if defined(__FreeBSD__)
-  ProcessFreeBSD::Initialize();
-#endif
-#if defined(__APPLE__)
-  SymbolVendorMacOSX::Initialize();
-  ProcessKDP::Initialize();
-  PlatformAppleTVSimulator::Initialize();
-  PlatformAppleWatchSimulator::Initialize();
-  PlatformRemoteAppleTV::Initialize();
-  PlatformRemoteAppleWatch::Initialize();
-  PlatformRemoteAppleBridge::Initialize();
-  DynamicLoaderDarwinKernel::Initialize();
-#endif
-
-  // This plugin is valid on any host that talks to a Darwin remote. It
-  // shouldn't be limited to __APPLE__.
-  StructuredDataDarwinLog::Initialize();
-
-  // Platform agnostic plugins
-  platform_gdb_server::PlatformRemoteGDBServer::Initialize();
-
-  process_gdb_remote::ProcessGDBRemote::Initialize();
-  DynamicLoaderMacOSXDYLD::Initialize();
-  DynamicLoaderMacOS::Initialize();
-  DynamicLoaderPOSIXDYLD::Initialize();
-  DynamicLoaderStatic::Initialize();
-  DynamicLoaderWindowsDYLD::Initialize();
+  // Initialize plugins
+#define LLDB_PLUGIN(p) p::Initialize();
+#include "Plugins/Plugins.def"
 
   // Scan for any system or user LLDB plug-ins
   PluginManager::Initialize();
@@ -301,7 +171,6 @@
   // The process settings need to know about installed plug-ins, so the
   // Settings must be initialized
   // AFTER PluginManager::Initialize is called.
-
   Debugger::SettingsInitialize();
 
   return llvm::Error::success();
@@ -316,112 +185,9 @@
   // Terminate and unload and loaded system or user LLDB plug-ins
   PluginManager::Terminate();
 
-  ClangASTContext::Terminate();
-
-  ArchitectureArm::Terminate();
-  ArchitectureMips::Terminate();
-  ArchitecturePPC64::Terminate();
-
-#define LLVM_TARGET(t) LLDB_PROCESS_ ## t(Terminate)
-#include "llvm/Config/Targets.def"
-
-  DisassemblerLLVMC::Terminate();
-
-  JITLoaderGDB::Terminate();
-  ProcessElfCore::Terminate();
-  ProcessMachCore::Terminate();
-  minidump::ProcessMinidump::Terminate();
-  MemoryHistoryASan::Terminate();
-  AddressSanitizerRuntime::Terminate();
-  ThreadSanitizerRuntime::Terminate();
-  UndefinedBehaviorSanitizerRuntime::Terminate();
-  MainThreadCheckerRuntime::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();
-  AppleObjCRuntimeV2::Terminate();
-  AppleObjCRuntimeV1::Terminate();
-  SystemRuntimeMacOSX::Terminate();
-  RenderScriptRuntime::Terminate();
-
-  CPlusPlusLanguage::Terminate();
-  ObjCLanguage::Terminate();
-  ObjCPlusPlusLanguage::Terminate();
-
-#if defined(__APPLE__)
-  DynamicLoaderDarwinKernel::Terminate();
-  ProcessKDP::Terminate();
-  SymbolVendorMacOSX::Terminate();
-  PlatformAppleTVSimulator::Terminate();
-  PlatformAppleWatchSimulator::Terminate();
-  PlatformRemoteAppleTV::Terminate();
-  PlatformRemoteAppleWatch::Terminate();
-  PlatformRemoteAppleBridge::Terminate();
-#endif
-
-#if defined(__FreeBSD__)
-  ProcessFreeBSD::Terminate();
-#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();
-#if defined(__APPLE__)
-  PlatformiOSSimulator::Terminate();
-  PlatformDarwinKernel::Terminate();
-#endif
-
-  breakpad::ObjectFileBreakpad::Terminate();
-  ObjectFileELF::Terminate();
-  ObjectFileMachO::Terminate();
-  ObjectFilePECOFF::Terminate();
-  wasm::ObjectFileWasm::Terminate();
-
-  ObjectContainerBSDArchive::Terminate();
-  ObjectContainerUniversalMachO::Terminate();
-
-#if LLDB_ENABLE_PYTHON
-  OperatingSystemPython::Terminate();
-#endif
-
-#if LLDB_ENABLE_PYTHON
-  ScriptInterpreterPython::Terminate();
-#endif
-
-#if LLDB_ENABLE_LUA
-  ScriptInterpreterLua::Terminate();
-#endif
+  // Terminate plugins
+#define LLDB_PLUGIN(p) p::Terminate();
+#include "Plugins/Plugins.def"
 
   // Now shutdown the common parts, in reverse order.
   SystemInitializerCommon::Terminate();
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to