[Lldb-commits] [lldb] c8001d5 - [lldb/Plugin] Fix some issues on Windows

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 17 17:22:28 PST 2020


Author: Jonas Devlieghere
Date: 2020-02-17T17:22:18-08:00
New Revision: c8001d56df620e5c961c7d459aecf1b90e7f937c

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

LOG: [lldb/Plugin] Fix some issues on Windows

 - Don't initialize NativePDB.
 - Initialize ProcessWindows after any Process*Core plugins.
 - Don't initialize DynamicLoaderDarwinKernel on non-Darwin platforms.

Added: 
    

Modified: 
    lldb/source/Plugins/CMakeLists.txt
    lldb/source/Plugins/DynamicLoader/CMakeLists.txt
    lldb/source/Plugins/Plugins.def.in
    lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
    lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/CMakeLists.txt b/lldb/source/Plugins/CMakeLists.txt
index 2ab29209810b..7e6276ea1d87 100644
--- a/lldb/source/Plugins/CMakeLists.txt
+++ b/lldb/source/Plugins/CMakeLists.txt
@@ -27,16 +27,20 @@ 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 "")
+# Some plugins depend on other plugins being loaded before. This hacks around
+# that issue by loading them last. Note that there's no order guarantee within
+# this category.
+set(LLDB_ENUM_PLUGINS_LOADED_LAST "")
 
 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} MATCHES "^ProcessWindows*")
+    set(LLDB_ENUM_PLUGINS_LOADED_LAST "${LLDB_ENUM_PLUGINS_LOADED_LAST}LLDB_PLUGIN(${pStripped})\n")
   elseif(${pStripped} STREQUAL "DynamicLoaderStatic")
-    set(LLDB_DYNAMIC_LOADER_STATIC "${LLDB_DYNAMIC_LOADER_STATIC}LLDB_PLUGIN(${pStripped})\n")
+    set(LLDB_ENUM_PLUGINS_LOADED_LAST "${LLDB_ENUM_PLUGINS_LOADED_LAST}LLDB_PLUGIN(${pStripped})\n")
   else()
     set(LLDB_ENUM_PLUGINS "${LLDB_ENUM_PLUGINS}LLDB_PLUGIN(${pStripped})\n")
   endif()

diff  --git a/lldb/source/Plugins/DynamicLoader/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/CMakeLists.txt
index f357fea02efb..bb0776dc497a 100644
--- a/lldb/source/Plugins/DynamicLoader/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/CMakeLists.txt
@@ -1,4 +1,6 @@
-add_subdirectory(Darwin-Kernel)
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  add_subdirectory(Darwin-Kernel)
+endif()
 add_subdirectory(MacOSX-DYLD)
 add_subdirectory(POSIX-DYLD)
 add_subdirectory(Static)

diff  --git a/lldb/source/Plugins/Plugins.def.in b/lldb/source/Plugins/Plugins.def.in
index 98977fc62d2a..63a68a17e6ec 100644
--- a/lldb/source/Plugins/Plugins.def.in
+++ b/lldb/source/Plugins/Plugins.def.in
@@ -30,7 +30,7 @@
 #endif
 
 @LLDB_ENUM_PLUGINS@
- at LLDB_DYNAMIC_LOADER_STATIC@
+ at LLDB_ENUM_PLUGINS_LOADED_LAST@
 
 #undef LLDB_PLUGIN
 #undef LLDB_SCRIPT_PLUGIN

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt b/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
index 4f19231c346c..7dab9370e512 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbPluginSymbolFileNativePDB PLUGIN
+add_lldb_library(lldbPluginSymbolFileNativePDB
   CodeViewRegisterMapping.cpp
   CompileUnitIndex.cpp
   DWARFLocationExpression.cpp

diff  --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
index e6819096f994..73dec53eda6a 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
@@ -66,8 +66,6 @@ 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) {


        


More information about the lldb-commits mailing list