[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.
This commit is contained in:
Jonas Devlieghere 2020-02-17 17:20:47 -08:00
parent c74026daf3
commit c8001d56df
5 changed files with 12 additions and 8 deletions

View File

@ -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()

View File

@ -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)

View File

@ -30,7 +30,7 @@
#endif
@LLDB_ENUM_PLUGINS@
@LLDB_DYNAMIC_LOADER_STATIC@
@LLDB_ENUM_PLUGINS_LOADED_LAST@
#undef LLDB_PLUGIN
#undef LLDB_SCRIPT_PLUGIN

View File

@ -1,4 +1,4 @@
add_lldb_library(lldbPluginSymbolFileNativePDB PLUGIN
add_lldb_library(lldbPluginSymbolFileNativePDB
CodeViewRegisterMapping.cpp
CompileUnitIndex.cpp
DWARFLocationExpression.cpp

View File

@ -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) {