Skip to content

[lldb][windows] Allow exporting plugin symbols in LLDB_EXPORT_ALL_SYMBOLS #71087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

River707
Copy link
Contributor

@River707 River707 commented Nov 2, 2023

Plugins aren't exported by default in the msvc path because we explicitly
limit the symbols exported to prevent hitting the symbol export limit.
Some plugins, however, can still be useful for downstream projects to
build on, e.g. the Mojo language uses parts of the dwarf plugin to implement
dwarf handling within its debugger plugin.

This PR adds a cmake variable in the MSVC path,
LLDB_EXPORT_ALL_SYMBOLS_PLUGINS, that allows for providing the set
of plugins to export symbols from.

@llvmbot
Copy link
Member

llvmbot commented Nov 2, 2023

@llvm/pr-subscribers-lldb

Author: River Riddle (River707)

Changes

These are already exported in non-windows builds, they aren't in the msvc path because we explicitly limit the symbols exported to prevent hitting the symbol export limit.

These symbols are useful for downstream projects that want to utilize code within the dwarf plugin. The Mojo language uses these to implement dwarf handling within its debugger plugin.


Full diff: https://github.com/llvm/llvm-project/pull/71087.diff

1 Files Affected:

  • (modified) lldb/source/API/CMakeLists.txt (+5-3)
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 895c6221a8073cf..76e6caceb392303 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -196,13 +196,15 @@ elseif (LLDB_EXPORT_ALL_SYMBOLS)
   MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
 
   # Pull out the various lldb libraries linked into liblldb, these will be used
-  # when looking for symbols to extract. We ignore plugin libraries here,
-  # because these symbols aren't publicly exposed.
+  # when looking for symbols to extract. We ignore most plugin libraries here,
+  # because we may expose more symbols than the DLL limit and these symbols
+  # aren't useful to expose.
   get_target_property(all_liblldb_libs liblldb LINK_LIBRARIES)
   set(lldb_libs "")
   foreach(lib ${all_liblldb_libs})
     if(TARGET ${lib} AND ${lib} MATCHES "^lldb" AND
-       NOT ${lib} MATCHES "^lldbPlugin")
+       (${lib} MATCHES "^lldbPluginSymbolFileDWARF" OR
+        NOT ${lib} MATCHES "^lldbPlugin"))
       get_target_property(lib_type ${lib} TYPE)
       if("${lib_type}" STREQUAL "STATIC_LIBRARY")
         list(APPEND lldb_libs ${lib})

…BOLS

Plugins aren't exported by default in the msvc path because we explicitly
limit the symbols exported to prevent hitting the symbol export limit.
Some plugins, however, can still be useful for downstream projects to
build on, e.g. the Mojo language uses parts of the dwarf plugin to implement
dwarf handling within its debugger plugin.

This PR adds a cmake variable in the MSVC path,
LLDB_EXPORT_ALL_SYMBOLS_PLUGINS, that allows for providing the set
of plugins to export symbols from.
Copy link
Member

@bulbazord bulbazord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@River707 River707 changed the title [lldb][windows] Export dwarf plugin symbols in LLDB_EXPORT_ALL_SYMBOLS [lldb][windows] Allow exporting plugin symbols in LLDB_EXPORT_ALL_SYMBOLS Nov 2, 2023
@River707
Copy link
Contributor Author

River707 commented Nov 2, 2023

Thanks for the reviews!!

@River707 River707 merged commit 8750239 into llvm:main Nov 2, 2023
@River707 River707 deleted the work_2 branch November 2, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants