-
Notifications
You must be signed in to change notification settings - Fork 352
[LLDB] Add progress updates for reflection metadata loading #11626
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] Add progress updates for reflection metadata loading #11626
Conversation
|
@swift-ci test |
lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp
Outdated
Show resolved
Hide resolved
| llvm::printEscapedString(dest, s); | ||
| return result; | ||
| }; | ||
| auto short_string = [](const std::string &dest) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
6d1ada2 to
59221dc
Compare
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.
59221dc to
377e888
Compare
|
@swift-ci test |
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.