Skip to content

Conversation

@adrian-prantl
Copy link

When debugging locally, parsing reflection metadata is instant. But when debugging over a slow network connection the amount of memory read packets being sent back and forth can indtroduce significan delays. To meake is easier to diagnose why an operation is stalling and to provide users with feedback about what LDB is doing this patch introduces a progress update in GetSwiftRuntimTypeInfo().

LLDB only publishes at meast 1 progress event every 20ms, so this is (visually) and performance-wise a noop wehen debugging locally.

@adrian-prantl
Copy link
Author

@swift-ci test

llvm::printEscapedString(dest, s);
return result;
};
auto short_string = [](const std::string &dest) {

Choose a reason for hiding this comment

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

I don't understand what this lambda does

Copy link
Author

Choose a reason for hiding this comment

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

I added a comment:

  /// Very quickly (this is a high-firing event), copy a few
  /// human-readable bytes usable as detail in the progress update.

target.ReadCStringFromMemory(addr, dest, error, force_live_memory);
if (error.Success()) {
if (m_progress_callback)
m_progress_callback(short_string(dest));

Choose a reason for hiding this comment

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

Do we need something similar on readBytesImpl as well?

Copy link
Author

Choose a reason for hiding this comment

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

I only picked ReadCString because that reads something we can put into the detail field of the progress event. My understanding is that moving an indefinite progress forward by one, without a message is effectively invisible to the user.

When debugging locally, parsing reflection metadata is instant. But
when debugging over a slow network connection the amount of memory
read packets being sent back and forth can indtroduce significan
delays. To meake is easier to diagnose why an operation is stalling
and to provide users with feedback about what LDB is doing this patch
introduces a progress update in GetSwiftRuntimTypeInfo().

LLDB only publishes at meast 1 progress event every 20ms, so this is
(visually) and performance-wise a noop wehen debugging locally.
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit b455b8b into swiftlang:stable/21.x Oct 14, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

4 participants