Index: lldb/cmake/caches/Apple-lldb-macOS.cmake =================================================================== --- lldb/cmake/caches/Apple-lldb-macOS.cmake +++ lldb/cmake/caches/Apple-lldb-macOS.cmake @@ -17,6 +17,20 @@ # DESTDIR will be an extra prefix. set(LLDB_DEBUGINFO_INSTALL_PREFIX /debuginfo CACHE STRING "") +# Disable platform plugins. +set(LLDB_PLUGIN_PLATFORM_ANDROID_BUILD OFF CACHE BOOL "") +set(LLDB_PLUGIN_PLATFORM_FREEBSD_BUILD OFF CACHE BOOL "") +set(LLDB_PLUGIN_PLATFORM_NETBSD_BUILD OFF CACHE BOOL "") +set(LLDB_PLUGIN_PLATFORM_OPENBSD_BUILD OFF CACHE BOOL "") +set(LLDB_PLUGIN_PLATFORM_WINDOWS_BUILD OFF CACHE BOOL "") + +# Disable minidump. +set(LLDB_PLUGIN_PROCESS_MINIDUMP_BUILD OFF CACHE BOOL "") + +# Disable breakpad. +set(LLDB_PLUGIN_SYMBOLFILE_BREAKPAD_BUILD OFF CACHE BOOL "") +set(LLDB_PLUGIN_OBJECTFILE_BREAKPAD_BUILD OFF CACHE BOOL "") + set(LLVM_DISTRIBUTION_COMPONENTS lldb liblldb Index: lldb/cmake/modules/AddLLDB.cmake =================================================================== --- lldb/cmake/modules/AddLLDB.cmake +++ lldb/cmake/modules/AddLLDB.cmake @@ -212,6 +212,12 @@ add_llvm_subdirectory(LLDB TOOL ${name}) endmacro() +macro(add_lldb_plugin_subdirectory name) + get_filename_component(plugin ${CMAKE_CURRENT_SOURCE_DIR} NAME) + string(TOUPPER ${plugin} pluginUPPER) + add_llvm_subdirectory(LLDB "PLUGIN_${pluginUPPER}" ${name}) +endmacro() + function(add_lldb_tool name) cmake_parse_arguments(ARG "ADD_TO_FRAMEWORK" "" "" ${ARGN}) if(LLDB_BUILD_FRAMEWORK AND ARG_ADD_TO_FRAMEWORK) Index: lldb/packages/Python/lldbsuite/test/test_categories.py =================================================================== --- lldb/packages/Python/lldbsuite/test/test_categories.py +++ lldb/packages/Python/lldbsuite/test/test_categories.py @@ -37,6 +37,7 @@ 'darwin-log': 'Darwin log tests', 'watchpoint': 'Watchpoint-related tests', 'lldb-vscode': 'Visual Studio Code debug adaptor tests', + 'minidump': 'Minidump tests', } Index: lldb/source/Plugins/ABI/CMakeLists.txt =================================================================== --- lldb/source/Plugins/ABI/CMakeLists.txt +++ lldb/source/Plugins/ABI/CMakeLists.txt @@ -1,5 +1,5 @@ foreach(target AArch64 ARM ARC Hexagon Mips PowerPC SystemZ X86) if (${target} IN_LIST LLVM_TARGETS_TO_BUILD) - add_subdirectory(${target}) + add_lldb_plugin_subdirectory(${target}) endif() endforeach() Index: lldb/source/Plugins/Architecture/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Architecture/CMakeLists.txt +++ lldb/source/Plugins/Architecture/CMakeLists.txt @@ -1,3 +1,3 @@ -add_subdirectory(Arm) -add_subdirectory(Mips) -add_subdirectory(PPC64) +add_lldb_plugin_subdirectory(Arm) +add_lldb_plugin_subdirectory(Mips) +add_lldb_plugin_subdirectory(PPC64) Index: lldb/source/Plugins/Disassembler/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Disassembler/CMakeLists.txt +++ lldb/source/Plugins/Disassembler/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory(LLVMC) +add_lldb_plugin_subdirectory(LLVMC) Index: lldb/source/Plugins/DynamicLoader/CMakeLists.txt =================================================================== --- lldb/source/Plugins/DynamicLoader/CMakeLists.txt +++ lldb/source/Plugins/DynamicLoader/CMakeLists.txt @@ -1,7 +1,7 @@ -add_subdirectory(Darwin-Kernel) -add_subdirectory(MacOSX-DYLD) -add_subdirectory(POSIX-DYLD) -add_subdirectory(Static) -add_subdirectory(Hexagon-DYLD) -add_subdirectory(Windows-DYLD) -add_subdirectory(wasm-DYLD) +add_lldb_plugin_subdirectory(Darwin-Kernel) +add_lldb_plugin_subdirectory(MacOSX-DYLD) +add_lldb_plugin_subdirectory(POSIX-DYLD) +add_lldb_plugin_subdirectory(Static) +add_lldb_plugin_subdirectory(Hexagon-DYLD) +add_lldb_plugin_subdirectory(Windows-DYLD) +add_lldb_plugin_subdirectory(wasm-DYLD) Index: lldb/source/Plugins/Instruction/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Instruction/CMakeLists.txt +++ lldb/source/Plugins/Instruction/CMakeLists.txt @@ -1,5 +1,5 @@ -add_subdirectory(ARM) -add_subdirectory(ARM64) -add_subdirectory(MIPS) -add_subdirectory(MIPS64) -add_subdirectory(PPC64) +add_lldb_plugin_subdirectory(ARM) +add_lldb_plugin_subdirectory(ARM64) +add_lldb_plugin_subdirectory(MIPS) +add_lldb_plugin_subdirectory(MIPS64) +add_lldb_plugin_subdirectory(PPC64) Index: lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt +++ lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt @@ -1,4 +1,4 @@ -add_subdirectory(ASan) -add_subdirectory(MainThreadChecker) -add_subdirectory(TSan) -add_subdirectory(UBSan) +add_lldb_plugin_subdirectory(ASan) +add_lldb_plugin_subdirectory(MainThreadChecker) +add_lldb_plugin_subdirectory(TSan) +add_lldb_plugin_subdirectory(UBSan) Index: lldb/source/Plugins/JITLoader/CMakeLists.txt =================================================================== --- lldb/source/Plugins/JITLoader/CMakeLists.txt +++ lldb/source/Plugins/JITLoader/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory(GDB) +add_lldb_plugin_subdirectory(GDB) Index: lldb/source/Plugins/Language/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Language/CMakeLists.txt +++ lldb/source/Plugins/Language/CMakeLists.txt @@ -1,4 +1,4 @@ +add_lldb_plugin_subdirectory(CPlusPlus) +add_lldb_plugin_subdirectory(ObjC) +add_lldb_plugin_subdirectory(ObjCPlusPlus) add_subdirectory(ClangCommon) -add_subdirectory(CPlusPlus) -add_subdirectory(ObjC) -add_subdirectory(ObjCPlusPlus) Index: lldb/source/Plugins/LanguageRuntime/CMakeLists.txt =================================================================== --- lldb/source/Plugins/LanguageRuntime/CMakeLists.txt +++ lldb/source/Plugins/LanguageRuntime/CMakeLists.txt @@ -1,3 +1,3 @@ -add_subdirectory(CPlusPlus) -add_subdirectory(ObjC) -add_subdirectory(RenderScript) +add_lldb_plugin_subdirectory(CPlusPlus) +add_lldb_plugin_subdirectory(ObjC) +add_lldb_plugin_subdirectory(RenderScript) Index: lldb/source/Plugins/MemoryHistory/CMakeLists.txt =================================================================== --- lldb/source/Plugins/MemoryHistory/CMakeLists.txt +++ lldb/source/Plugins/MemoryHistory/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory(asan) +add_lldb_plugin_subdirectory(asan) Index: lldb/source/Plugins/ObjectContainer/CMakeLists.txt =================================================================== --- lldb/source/Plugins/ObjectContainer/CMakeLists.txt +++ lldb/source/Plugins/ObjectContainer/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory(BSD-Archive) -add_subdirectory(Universal-Mach-O) +add_lldb_plugin_subdirectory(BSD-Archive) +add_lldb_plugin_subdirectory(Universal-Mach-O) Index: lldb/source/Plugins/ObjectFile/CMakeLists.txt =================================================================== --- lldb/source/Plugins/ObjectFile/CMakeLists.txt +++ lldb/source/Plugins/ObjectFile/CMakeLists.txt @@ -1,6 +1,6 @@ -add_subdirectory(Breakpad) -add_subdirectory(ELF) -add_subdirectory(Mach-O) -add_subdirectory(PECOFF) -add_subdirectory(JIT) -add_subdirectory(wasm) \ No newline at end of file +add_lldb_plugin_subdirectory(Breakpad) +add_lldb_plugin_subdirectory(ELF) +add_lldb_plugin_subdirectory(Mach-O) +add_lldb_plugin_subdirectory(PECOFF) +add_lldb_plugin_subdirectory(JIT) +add_lldb_plugin_subdirectory(wasm) \ No newline at end of file Index: lldb/source/Plugins/OperatingSystem/CMakeLists.txt =================================================================== --- lldb/source/Plugins/OperatingSystem/CMakeLists.txt +++ lldb/source/Plugins/OperatingSystem/CMakeLists.txt @@ -1,3 +1,3 @@ if (LLDB_ENABLE_PYTHON) - add_subdirectory(Python) + add_lldb_plugin_subdirectory(Python) endif() Index: lldb/source/Plugins/Platform/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Platform/CMakeLists.txt +++ lldb/source/Plugins/Platform/CMakeLists.txt @@ -1,17 +1,17 @@ #if (CMAKE_SYSTEM_NAME MATCHES "Linux") - add_subdirectory(Linux) + add_lldb_plugin_subdirectory(Linux) #elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - add_subdirectory(FreeBSD) + add_lldb_plugin_subdirectory(FreeBSD) #elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") - add_subdirectory(NetBSD) + add_lldb_plugin_subdirectory(NetBSD) #elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") - add_subdirectory(OpenBSD) + add_lldb_plugin_subdirectory(OpenBSD) #elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_subdirectory(MacOSX) + add_lldb_plugin_subdirectory(MacOSX) #elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") - add_subdirectory(Windows) + add_lldb_plugin_subdirectory(Windows) #endif() -add_subdirectory(POSIX) -add_subdirectory(gdb-server) -add_subdirectory(Android) +add_lldb_plugin_subdirectory(POSIX) +add_lldb_plugin_subdirectory(gdb-server) +add_lldb_plugin_subdirectory(Android) Index: lldb/source/Plugins/Process/CMakeLists.txt =================================================================== --- lldb/source/Plugins/Process/CMakeLists.txt +++ lldb/source/Plugins/Process/CMakeLists.txt @@ -1,19 +1,19 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") - add_subdirectory(Linux) - add_subdirectory(POSIX) + add_lldb_plugin_subdirectory(Linux) + add_lldb_plugin_subdirectory(POSIX) elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - add_subdirectory(FreeBSD) - add_subdirectory(POSIX) + add_lldb_plugin_subdirectory(FreeBSD) + add_lldb_plugin_subdirectory(POSIX) elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") - add_subdirectory(NetBSD) - add_subdirectory(POSIX) + add_lldb_plugin_subdirectory(NetBSD) + add_lldb_plugin_subdirectory(POSIX) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") - add_subdirectory(Windows/Common) + add_lldb_plugin_subdirectory(Windows/Common) elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_subdirectory(MacOSX-Kernel) + add_lldb_plugin_subdirectory(MacOSX-Kernel) endif() -add_subdirectory(gdb-remote) -add_subdirectory(Utility) -add_subdirectory(elf-core) -add_subdirectory(mach-core) -add_subdirectory(minidump) +add_lldb_plugin_subdirectory(gdb-remote) +add_lldb_plugin_subdirectory(Utility) +add_lldb_plugin_subdirectory(elf-core) +add_lldb_plugin_subdirectory(mach-core) +add_lldb_plugin_subdirectory(minidump) Index: lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt =================================================================== --- lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt +++ lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt @@ -1,8 +1,8 @@ -add_subdirectory(None) +add_lldb_plugin_subdirectory(None) if (LLDB_ENABLE_PYTHON) - add_subdirectory(Python) + add_lldb_plugin_subdirectory(Python) endif() if (LLDB_ENABLE_LUA) - add_subdirectory(Lua) + add_lldb_plugin_subdirectory(Lua) endif() Index: lldb/source/Plugins/StructuredData/CMakeLists.txt =================================================================== --- lldb/source/Plugins/StructuredData/CMakeLists.txt +++ lldb/source/Plugins/StructuredData/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory(DarwinLog) +add_lldb_plugin_subdirectory(DarwinLog) Index: lldb/source/Plugins/SymbolFile/CMakeLists.txt =================================================================== --- lldb/source/Plugins/SymbolFile/CMakeLists.txt +++ lldb/source/Plugins/SymbolFile/CMakeLists.txt @@ -1,5 +1,5 @@ -add_subdirectory(Breakpad) -add_subdirectory(DWARF) -add_subdirectory(Symtab) -add_subdirectory(NativePDB) -add_subdirectory(PDB) +add_lldb_plugin_subdirectory(Breakpad) +add_lldb_plugin_subdirectory(DWARF) +add_lldb_plugin_subdirectory(Symtab) +add_lldb_plugin_subdirectory(NativePDB) +add_lldb_plugin_subdirectory(PDB) Index: lldb/source/Plugins/SymbolVendor/CMakeLists.txt =================================================================== --- lldb/source/Plugins/SymbolVendor/CMakeLists.txt +++ lldb/source/Plugins/SymbolVendor/CMakeLists.txt @@ -1,6 +1,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_subdirectory(MacOSX) + add_lldb_plugin_subdirectory(MacOSX) endif() -add_subdirectory(ELF) -add_subdirectory(wasm) +add_lldb_plugin_subdirectory(ELF) +add_lldb_plugin_subdirectory(wasm) Index: lldb/source/Plugins/SystemRuntime/CMakeLists.txt =================================================================== --- lldb/source/Plugins/SystemRuntime/CMakeLists.txt +++ lldb/source/Plugins/SystemRuntime/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory(MacOSX) +add_lldb_plugin_subdirectory(MacOSX) Index: lldb/source/Plugins/TypeSystem/CMakeLists.txt =================================================================== --- lldb/source/Plugins/TypeSystem/CMakeLists.txt +++ lldb/source/Plugins/TypeSystem/CMakeLists.txt @@ -1 +1 @@ -add_subdirectory(Clang) +add_lldb_plugin_subdirectory(Clang) Index: lldb/source/Plugins/UnwindAssembly/CMakeLists.txt =================================================================== --- lldb/source/Plugins/UnwindAssembly/CMakeLists.txt +++ lldb/source/Plugins/UnwindAssembly/CMakeLists.txt @@ -1,2 +1,2 @@ -add_subdirectory(InstEmulation) -add_subdirectory(x86) +add_lldb_plugin_subdirectory(InstEmulation) +add_lldb_plugin_subdirectory(x86) Index: lldb/test/API/CMakeLists.txt =================================================================== --- lldb/test/API/CMakeLists.txt +++ lldb/test/API/CMakeLists.txt @@ -43,6 +43,10 @@ -u CFLAGS ) +if (NOT LLDB_PLUGIN_PROCESS_MINIDUMP_BUILD) + list(APPEND LLDB_TEST_COMMON_ARGS --skip-category minidump) +endif() + # Set the path to the default lldb test executable. set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}") Index: lldb/test/API/functionalities/postmortem/minidump-new/.categories =================================================================== --- /dev/null +++ lldb/test/API/functionalities/postmortem/minidump-new/.categories @@ -0,0 +1 @@ +minidump Index: lldb/test/API/functionalities/postmortem/minidump/.categories =================================================================== --- /dev/null +++ lldb/test/API/functionalities/postmortem/minidump/.categories @@ -0,0 +1 @@ +minidump Index: lldb/test/API/functionalities/postmortem/wow64_minidump/.categories =================================================================== --- /dev/null +++ lldb/test/API/functionalities/postmortem/wow64_minidump/.categories @@ -0,0 +1 @@ +minidump Index: lldb/test/CMakeLists.txt =================================================================== --- lldb/test/CMakeLists.txt +++ lldb/test/CMakeLists.txt @@ -153,7 +153,11 @@ LLDB_ENABLE_LZMA LLVM_ENABLE_ZLIB LLVM_ENABLE_SHARED_LIBS - LLDB_IS_64_BITS) + LLDB_IS_64_BITS + LLDB_PLUGIN_OBJECTFILE_BREAKPAD_BUILD + LLDB_PLUGIN_SYMBOLFILE_BREAKPAD_BUILD + LLDB_PLUGIN_PROCESS_MINIDUMP_BUILD + ) # Configure the individual test suites. add_subdirectory(API) Index: lldb/test/Shell/Minidump/breakpad-symbols.test =================================================================== --- lldb/test/Shell/Minidump/breakpad-symbols.test +++ lldb/test/Shell/Minidump/breakpad-symbols.test @@ -1,3 +1,4 @@ +# REQUIRES: breakpad # Test that we can attach breakpad symbols to the "placeholder" modules created # for minidump files. # Index: lldb/test/Shell/Minidump/lit.local.cfg =================================================================== --- lldb/test/Shell/Minidump/lit.local.cfg +++ lldb/test/Shell/Minidump/lit.local.cfg @@ -1 +1,4 @@ config.suffixes = ['.test', '.yaml'] + +if 'minidump' not in config.available_features: + config.unsupported = True Index: lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg =================================================================== --- lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg +++ lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg @@ -1 +1,4 @@ config.suffixes = ['.test'] + +if 'breakpad' not in config.available_features: + config.unsupported = True Index: lldb/test/Shell/SymbolFile/Breakpad/lit.local.cfg =================================================================== --- /dev/null +++ lldb/test/Shell/SymbolFile/Breakpad/lit.local.cfg @@ -0,0 +1,2 @@ +if 'breakpad' not in config.available_features: + config.unsupported = True Index: lldb/test/Shell/lit.cfg.py =================================================================== --- lldb/test/Shell/lit.cfg.py +++ lldb/test/Shell/lit.cfg.py @@ -52,6 +52,12 @@ lit_config.note("Running Shell test with lldb-repo in {} mode.".format(lldb_repro_mode)) toolchain.use_lldb_repro_substitutions(config, lldb_repro_mode) +if config.lldb_enable_breakpad: + config.available_features.add('breakpad') + +if config.lldb_enable_minidump: + config.available_features.add('minidump') + llvm_config.use_default_substitutions() toolchain.use_lldb_substitutions(config) toolchain.use_support_substitutions(config) Index: lldb/test/Shell/lit.site.cfg.py.in =================================================================== --- lldb/test/Shell/lit.site.cfg.py.in +++ lldb/test/Shell/lit.site.cfg.py.in @@ -20,6 +20,8 @@ config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32 config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.lldb_enable_lua = @LLDB_ENABLE_LUA@ +config.lldb_enable_breakpad = @LLDB_PLUGIN_OBJECTFILE_BREAKPAD_BUILD@ and @LLDB_PLUGIN_SYMBOLFILE_BREAKPAD_BUILD@ +config.lldb_enable_minidump = @LLDB_PLUGIN_PROCESS_MINIDUMP_BUILD@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" # The shell tests use their own module caches. config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell") Index: lldb/unittests/ObjectFile/CMakeLists.txt =================================================================== --- lldb/unittests/ObjectFile/CMakeLists.txt +++ lldb/unittests/ObjectFile/CMakeLists.txt @@ -1,3 +1,5 @@ -add_subdirectory(Breakpad) +if (LLDB_PLUGIN_OBJECTFILE_BREAKPAD_BUILD) + add_subdirectory(Breakpad) +endif() add_subdirectory(ELF) add_subdirectory(PECOFF) Index: lldb/unittests/Process/CMakeLists.txt =================================================================== --- lldb/unittests/Process/CMakeLists.txt +++ lldb/unittests/Process/CMakeLists.txt @@ -1,6 +1,10 @@ -add_subdirectory(gdb-remote) if (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") add_subdirectory(Linux) add_subdirectory(POSIX) endif() -add_subdirectory(minidump) +if (LLDB_PLUGIN_PROCESS_GDB_REMOTE_BUILD) + add_subdirectory(gdb-remote) +endif() +if (LLDB_PLUGIN_PROCESS_MINIDUMP_BUILD) + add_subdirectory(minidump) +endif()