[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-04 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Looking this over again, I do see two open questions.

The first is that there is a disconnect between the place which *declares* 
something to be a plugin (the PLUGIN argument to add_lldb_library), and the 
place which *disables* something as a plugin (the macro invocation in the 
parent CMakeLists.txt). This creates a lot of potential for confusion and 
inconsistencies -- and indeed this patch already introduces some of those.

The second is the boilerplate required to disable the relevant tests. Right now 
you've just added the couple of features that you needed to disable the plugins 
of your choosing, but if we did that for all plugins, the code to do that would 
become fairly repetitive.

I am wondering if there isn't a way to solve both of these problems. For 
example, if we moved the disabling logic to the `add_lldb_library` function, 
then we could guarantee that only "real" plugins are eligible for being 
disabled. Also, since we already maintain a list of all plugin libraries, we 
could use this list to generate the appropriate lit features.

This would mean that we would not be able to reuse the llvm logic for skipping 
a directory, but that is literally just 4 lines of code, so I don't think it 
would be much of an issue. That may even make sense, because that llvm 
machinery was meant for disabling tools or entire subprojects, and not as a 
fine-grained control mechanism like this. In fact, this feature is kind of more 
similar to one choosing which components go into libLLVM.so, which is handled 
by a separate mechanism (LLVM_DYLIB_COMPONENTS).

Finally (though I don't know if you would consider this a feature or not), this 
way we might be able to arrange things so that the relevant plugins still get 
built even though they don't make their way into liblldb. That way one could 
still ensure that the relevant plugins build properly, and their unit tests 
could still run.




Comment at: lldb/source/Plugins/LanguageRuntime/CMakeLists.txt:1-3
+add_lldb_plugin_subdirectory(CPlusPlus)
+add_lldb_plugin_subdirectory(ObjC)
+add_lldb_plugin_subdirectory(RenderScript)

This isn't right. The actual plugins are located one level down 
(CPlusPlus/ItaniumABI, ObjC/AppleObjCRuntime, RenderScript/RenderScriptRuntime)



Comment at: lldb/source/Plugins/Process/CMakeLists.txt: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")

Some of these (Utility, Linux, NetBSD) aren't "real" plugins.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 247947.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016

Files:
  lldb/cmake/caches/Apple-lldb-macOS.cmake
  lldb/cmake/modules/AddLLDB.cmake
  lldb/packages/Python/lldbsuite/test/test_categories.py
  lldb/source/Plugins/ABI/CMakeLists.txt
  lldb/source/Plugins/Architecture/CMakeLists.txt
  lldb/source/Plugins/Disassembler/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/Instruction/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt
  lldb/source/Plugins/JITLoader/CMakeLists.txt
  lldb/source/Plugins/Language/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CMakeLists.txt
  lldb/source/Plugins/MemoryHistory/CMakeLists.txt
  lldb/source/Plugins/ObjectContainer/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/CMakeLists.txt
  lldb/source/Plugins/OperatingSystem/CMakeLists.txt
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Process/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/StructuredData/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/CMakeLists.txt
  lldb/source/Plugins/SystemRuntime/CMakeLists.txt
  lldb/source/Plugins/TypeSystem/CMakeLists.txt
  lldb/source/Plugins/UnwindAssembly/CMakeLists.txt
  lldb/test/API/CMakeLists.txt
  lldb/test/API/functionalities/postmortem/minidump-new/.categories
  lldb/test/API/functionalities/postmortem/minidump/.categories
  lldb/test/API/functionalities/postmortem/wow64_minidump/.categories
  lldb/test/CMakeLists.txt
  lldb/test/Shell/Minidump/breakpad-symbols.test
  lldb/test/Shell/Minidump/lit.local.cfg
  lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg
  lldb/test/Shell/SymbolFile/Breakpad/lit.local.cfg
  lldb/test/Shell/lit.cfg.py
  lldb/test/Shell/lit.site.cfg.py.in
  lldb/unittests/ObjectFile/CMakeLists.txt
  lldb/unittests/Process/CMakeLists.txt

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()
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/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/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/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/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/Minidump/lit.local.cfg

[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-02 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

I like the idea! The one thing that kind of bothers me about this is you can 
inadvertently break your build without realizing by disabling a plugin that 
some enabled plugins depend on. Hopefully one day we'll be able to improve the 
diagnostics around this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere planned changes to this revision.
JDevlieghere marked an inline comment as done.
JDevlieghere added a comment.

In D73016#1900403 , @labath wrote:

> This looks fine, but I think you'll first need to handle the lit changes to 
> allow skipping tests. Otherwise all of the pdb and breakpad tests will break 
> once you do this. I guess the reason that this hasn't happened yet is because 
> you have a typo in your cache file.


Right, I fixed the cache and then applied an old diff again. Shouldn't have 
tried to squeeze this in on a Sunday night. With the right cache values 
`lldb-server` is failing to link, so I'll have to take a look at that too.




Comment at: lldb/source/API/SBCommandReturnObject.cpp:98-101
+  std::ofstream reproducer_log_file;
+  
reproducer_log_file.open(lldb_private::repro::Reproducer::Instance().IsCapturing()
 ? "/tmp/capture.log" : "/tmp/replay.log", std::fstream::app);
+  reproducer_log_file << output.AsCString(/*value_if_empty*/ "") << "\n";
+  reproducer_log_file.close();

labath wrote:
> ?
Ugh, this should've been stashed, I was digging into some reproducer failure. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

This looks fine, but I think you'll first need to handle the lit changes to 
allow skipping tests. Otherwise all of the pdb and breakpad tests will break 
once you do this. I guess the reason that this hasn't happened yet is because 
you have a typo in your cache file.




Comment at: lldb/source/API/SBCommandReturnObject.cpp:98-101
+  std::ofstream reproducer_log_file;
+  
reproducer_log_file.open(lldb_private::repro::Reproducer::Instance().IsCapturing()
 ? "/tmp/capture.log" : "/tmp/replay.log", std::fstream::app);
+  reproducer_log_file << output.AsCString(/*value_if_empty*/ "") << "\n";
+  reproducer_log_file.close();

?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-03-01 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 247552.
JDevlieghere added a comment.

- Rebased.
- Tested the cache configuration on macOS.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016

Files:
  lldb/cmake/caches/Apple-lldb-macOS.cmake
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/API/SBCommandReturnObject.cpp
  lldb/source/Plugins/ABI/CMakeLists.txt
  lldb/source/Plugins/Architecture/CMakeLists.txt
  lldb/source/Plugins/Disassembler/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/Instruction/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt
  lldb/source/Plugins/JITLoader/CMakeLists.txt
  lldb/source/Plugins/Language/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CMakeLists.txt
  lldb/source/Plugins/MemoryHistory/CMakeLists.txt
  lldb/source/Plugins/ObjectContainer/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/CMakeLists.txt
  lldb/source/Plugins/OperatingSystem/CMakeLists.txt
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Process/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/StructuredData/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/CMakeLists.txt
  lldb/source/Plugins/SystemRuntime/CMakeLists.txt
  lldb/source/Plugins/TypeSystem/CMakeLists.txt
  lldb/source/Plugins/UnwindAssembly/CMakeLists.txt

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

[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D73016#1830303 , @JDevlieghere 
wrote:

> - I'm aware of the linker issue when you reconfigure. I've spent quite some 
> time investigating this and this seems related to the way libraries to link 
> are cached by CMake. I verified that we're no longer passing the disabled 
> library to target_link_libraries and yet the linker error remains. It looks 
> like this might be fix starting with CMake 3.12 
> (https://cmake.org/cmake/help/git-stage/policy/CMP0073.html).


Interesting. This looks like something that we could hac^H^H^Hwork around even 
with cmake<=3.12 by force-setting the appropriate variable to "". If we cared 
enough about this, that is...


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-20 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

- I'm aware of the linker issue when you reconfigure. I've spent quite some 
time investigating this and this seems related to the way libraries to link are 
cached by CMake. I verified that we're no longer passing the disabled library 
to target_link_libraries and yet the linker error remains. It looks like this 
might be fix starting with CMake 3.12 
(https://cmake.org/cmake/help/git-stage/policy/CMP0073.html).
- I've uploaded a patch for the system initializers: 
https://reviews.llvm.org/D73067

Very strong +1 on your last two points. I think I'll experiment a bit and then 
see which plugins I care about and how they affect the tests. I'll add a 
comment to the macro saying that using this functionality is a 100% at your own 
risk.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In principle, I think this is a good idea. We do have many optional components 
(and even more components that should be optional but aren't), that one may not 
need/want when building lldb for a specific use case. Also, libLLVM is 
configurable in a similar way. However:

- as Raphael pointed out, this is incomplete. I'm not too worried about 
managing dependencies -- I'd consider this an expert feature, and I am happy 
with leaving it up to the user to ensure he does not disable a plugin that is 
used elsewhere (he should get a link error if he does). But that still leaves 
the question of how to register the plugins at startup. We currently have a 
hand-curated list of plugins in the SystemInitializer classes, and that will 
need to change somehow. This is further complicated by the fact that some 
plugins are also needed for lldb-server, while others (most) are used in 
liblldb only. The simplest solution (for usage, but maybe not for 
implementation) would be to have the plugins auto-register themselves via a 
global constructor. Some parts of llvm already to that, and we could create a 
special class for this which would also carry the annotations necessary to 
surpress the global constructor warnings. The alternative is to throw in a 
bunch of ifdefs into the SystemInitializers, which isn't particularly nice 
(though maybe it could be generated in cmake or via some `.def` tricks).
- there will also be a need to somehow disable the tests for the relevant 
plugins. For instance all the NativePDB tests will fail when disabling that 
plugin (even on darwin, as the tests are written in a way to not require a 
windows host). I don't think we need to annotate all tests with the exact list 
of plugins that the require (that can be up to whoever wants to ensure that 
some configuration keeps working), but we should create some mechanism to do 
that.
- I also wouldn't advertise this too much. Using these settings can easily send 
someone into uncharted waters, with random unexpected build errors or test 
failures -- we have enough of those even without new settings. And unlike 
LLVM_TARGETS_TO_BUILD, I doubt disabling some plugins will have measurable 
impact on the build time...


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-19 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

How does this deal with linking flags etc.? Your cmake cache disabled 
`LLDB_PLUGIN_SYMBOLFILE_NATIVEPDB_BUILD` (well, it would without the LDB typo) 
but that just gives me a build that fails to link with `ld: error: unable to 
find library -llldbPluginSymbolFileNativePDB`.

Do we want to deal with dependencies between plugins? E.g. Language/CPlusPlus 
depending on Language/ClangCommon, so will CPlusPlus disabled too if I disable 
ClangCommon?




Comment at: lldb/cmake/caches/Apple-lldb-macOS.cmake:21
+# Disable platform plugins.
+set(LDB_PLUGIN_PLATFORM_ANDROID_BUILD OFF CACHE BOOL "")
+set(LDB_PLUGIN_PLATFORM_FREEBSD_BUILD OFF CACHE BOOL "")

`LDB` -> `LLDB` (here and in your description).


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73016/new/

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-19 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: xiaobai, labath, LLDB.
Herald added subscribers: teemperor, abidh, aheejin, mgorny.
Herald added a project: LLDB.

This patch introduces a new CMake macro `add_lldb_plugin_subdirectory` to be 
used by the plugins. It's similar to `add_lldb_tool_subdirectory` which makes 
it possible to disable certain tools at configuration time. With the new macro, 
the same is possible for plugins. The difference is that it includes the 
plugin's parent directory in the name as well, so that the variable is named 
`LDB_PLUGIN_SYMBOLFILE_PDF_BUILD` rather than `LDB_PLUGIN_PDB_BUILD`.

I've updated the macOS CMake cache to give an idea of what this looks like.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D73016

Files:
  lldb/cmake/caches/Apple-lldb-macOS.cmake
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/Plugins/ABI/CMakeLists.txt
  lldb/source/Plugins/Architecture/CMakeLists.txt
  lldb/source/Plugins/Disassembler/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/ExpressionParser/CMakeLists.txt
  lldb/source/Plugins/Instruction/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt
  lldb/source/Plugins/JITLoader/CMakeLists.txt
  lldb/source/Plugins/Language/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/RenderScript/CMakeLists.txt
  lldb/source/Plugins/MemoryHistory/CMakeLists.txt
  lldb/source/Plugins/ObjectContainer/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/CMakeLists.txt
  lldb/source/Plugins/OperatingSystem/CMakeLists.txt
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/source/Plugins/Process/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
  lldb/source/Plugins/StructuredData/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/CMakeLists.txt
  lldb/source/Plugins/SystemRuntime/CMakeLists.txt
  lldb/source/Plugins/UnwindAssembly/CMakeLists.txt

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/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/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/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/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/ScriptInterpreter/None/CMakeLists.txt
===
--- lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
+++ lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
@@ -4,4 +4,4 @@
   LINK_LIBS
 lldbCore
 lldbInterpreter
-  )
\ No newline at end of file
+  )
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)