Skip to content
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

LLDB never finishes importing Swift modules/setting up Swift reflection #8572

Closed
z2oh opened this issue Apr 12, 2024 · 3 comments
Closed

LLDB never finishes importing Swift modules/setting up Swift reflection #8572

z2oh opened this issue Apr 12, 2024 · 3 comments
Assignees

Comments

@z2oh
Copy link

z2oh commented Apr 12, 2024

image

These notifications in VS Code never go away during a debugging session. It's possible there's an issue on the client side, but I'm thinking the issue is in LLDB.

The Progress object which reports the reflection status is set up here:

Progress progress("Setting up Swift reflection");

This ctor takes an optional total parameter, which, as Progress::increment is called, is compared against to see when the operation is complete. When it's not set, the docs indicate that an indeterminate progress indicator should be displayed, but as far as I can tell, there's no way to report completion of this (which is normally triggered when Progress::m_completed == Progress::m_total).

It looks like the reflection progress object used to be constructed with a total, and with the following patch, I am no longer seeing the permanent "Setting up swift reflection" indicator:

diff --git a/lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp
index 76a65ead7ff9..d3b83c784571 100644
--- a/lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp
@@ -502,7 +502,7 @@ void SwiftLanguageRuntimeImpl::ProcessModulesToAdd() {

   auto &target = m_process.GetTarget();
   auto exe_module = target.GetExecutableModule();
-  Progress progress("Setting up Swift reflection");
+  Progress progress("Setting up Swift reflection", {}, modules_to_add_snapshot.GetSize());
   size_t completion = 0;

   // Add all defered modules to reflection context that were added to

The preferred total is less obvious for the "Importing Swift modules" progress events (here and here). Any ideas on what these totals should be?

cc @chelcassanova, it looks like you've been driving the improvements to the lldb reporting feature

@chelcassanova
Copy link

Hey Jeremy, thanks for tagging me in this and also for the patch! The "Setting up Swift reflection" report is indeed missing a total and your patch is correct, if you're able to put that patch up for review and add me as a reviewer that would be great 👍🏾 .

For the "Importing Swift modules" report, we actually have that as an indeterminate report so it doesn't have a total. The multiple reports you're seeing for "Importing Swift modules" is a bug that I'm looking into, thanks again for bringing this up!

@z2oh
Copy link
Author

z2oh commented Apr 16, 2024

I appreciate you looking into this @chelcassanova! PR with the aforementioned patch is up here #8584

(I don't think I have the right repo privileges to manually specify reviewers)

@chelcassanova
Copy link

Fixed in #8623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants