Skip to content

[lldb-vscode] Make descriptive summaries and raw child for synthetics configurable #65687

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 2 commits into from
Sep 11, 2023

Conversation

walter-erquinigo
Copy link
Member

@walter-erquinigo walter-erquinigo commented Sep 7, 2023

"descriptive summaries" should only be used for small to medium binaries because of the performance penalty the cause when completing types. I'm defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well. I'm defaulting it to false.

Both options can be set via a launch or attach config, following the pattern of most settings. javascript extension wrappers can set these settings on their own as well.

@github-actions github-actions bot added the lldb label Sep 7, 2023
@walter-erquinigo walter-erquinigo marked this pull request as ready for review September 7, 2023 22:38
@walter-erquinigo walter-erquinigo requested a review from a team as a code owner September 7, 2023 22:38
@@ -40,7 +40,8 @@ VSCode::VSCode()
{"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
{"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
stop_at_entry(false), is_attach(false),
stop_at_entry(false), is_attach(false), show_descriptive_summaries(false),
show_raw_child_for_synthetics(false),
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't show_raw_child_for_synthetics be true by default?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, we want these off by default. I don't want to see a "[raw]" entry at the end of all synthetic variables each time I debug. Also the descriptive summaries are way too expensive to enable as they will cause all types to always be completed. Say you have 100 variables in your variable view, if you don't turn them down in the variable view, we never need to complete the types for these entries, but with this change enabled, all variable types (and if each type is a class, all subclasses, and all ivars from the current and subclasses will be completed) will always be completed even if they aren't turned down. This was the reason we originally made the "SBValue::MightHaveChildren()" (it doesn't complete a type, it just says "if you are a struct, then you might have children" and then we can display the disclosure triange in the UI without completing the type) as objective C debugging variables were always class pointers that didn't need to be completed. We saw a huge performance gain when we didn't complete a type and displaying variables in Xcode many years ago, so we know this is an issue.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the context Greg. The commit description and the rawChildForSynthetics property both say the default is true, so that needs to be updated. My comment here was strictly referring to the boolean to make sure it was consistent with the other two, but it seems like that's not what we want.

@@ -40,7 +40,8 @@ VSCode::VSCode()
{"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
{"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
stop_at_entry(false), is_attach(false),
stop_at_entry(false), is_attach(false), show_descriptive_summaries(false),
show_raw_child_for_synthetics(false),
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, we want these off by default. I don't want to see a "[raw]" entry at the end of all synthetic variables each time I debug. Also the descriptive summaries are way too expensive to enable as they will cause all types to always be completed. Say you have 100 variables in your variable view, if you don't turn them down in the variable view, we never need to complete the types for these entries, but with this change enabled, all variable types (and if each type is a class, all subclasses, and all ivars from the current and subclasses will be completed) will always be completed even if they aren't turned down. This was the reason we originally made the "SBValue::MightHaveChildren()" (it doesn't complete a type, it just says "if you are a struct, then you might have children" and then we can display the disclosure triange in the UI without completing the type) as objective C debugging variables were always class pointers that didn't need to be completed. We saw a huge performance gain when we didn't complete a type and displaying variables in Xcode many years ago, so we know this is an issue.

@walter-erquinigo
Copy link
Member Author

@clayborg , do you get notifications when I update the PR? :) I'm still getting used to github for llvm.
In any case, this is ready for review.

Copy link
Collaborator

@clayborg clayborg left a comment

Choose a reason for hiding this comment

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

Looks good!

@tru
Copy link
Collaborator

tru commented Sep 11, 2023

Note that the formatting check failed! It shouldn't be ignored :)

… configurable

"descriptive summaries" should only be used for small to medium binaries because of the performance penalty the cause when completing types. I'm defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well. I'm defaulting it to false as well.

Both options can be set via a launch or attach config, following the pattern of most settings. javascript extension wrappers can set these settings on their own as well.
@walter-erquinigo walter-erquinigo merged commit a2a9918 into llvm:main Sep 11, 2023
@walter-erquinigo walter-erquinigo deleted the walter/settings branch September 11, 2023 21:00
AntonRydahl pushed a commit to AntonRydahl/llvm-project that referenced this pull request Sep 11, 2023
… configurable (llvm#65687)

"descriptive summaries" should only be used for small to medium binaries
because of the performance penalty the cause when completing types. I'm
defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well.
I'm defaulting it to false.

Both options can be set via a launch or attach config, following the
pattern of most settings. javascript extension wrappers can set these
settings on their own as well.
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
… configurable (llvm#65687)

"descriptive summaries" should only be used for small to medium binaries
because of the performance penalty the cause when completing types. I'm
defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well.
I'm defaulting it to false.

Both options can be set via a launch or attach config, following the
pattern of most settings. javascript extension wrappers can set these
settings on their own as well.
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Jan 18, 2024
… configurable (llvm#65687)

"descriptive summaries" should only be used for small to medium binaries
because of the performance penalty the cause when completing types. I'm
defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well.
I'm defaulting it to false.

Both options can be set via a launch or attach config, following the
pattern of most settings. javascript extension wrappers can set these
settings on their own as well.

(cherry picked from commit a2a9918)
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