Skip to content

[lldb] Reduce max-children-depth default for readability #10683

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

Open
wants to merge 2 commits into
base: swift/release/6.2
Choose a base branch
from

Conversation

kastiglione
Copy link

@kastiglione kastiglione commented May 14, 2025

Decrease target.max-children-depth from 6 to 4. Often the value of 6 produces too much
output, particularly with Swift data where, unlike ObjC, classes are not treated as
pointers and thus are traversed just like structs.

For a hypothetical recursive struct with just two members/properties, a depth of 6
results in 63 (2^6-1) child values printed. In practice, data types commonly have more
than two fields, and so hundred of child values can be printed. An output of only 63
would be closer to a best case scenario. This doesn't factor in lldb's data output
syntax, which adds additional non-data lines to the output.

When all children must be shown, frame variable and expression both support the -A
(--show-all-children) flag.

rdar://145327522

Decrease `target.max-children-depth` from 6 to 4. Often the value of 6 produces too much
output, particularly with Swift data where, unlike ObjC, classes are not treated as
pointers and thus are traversed just like structs.

For a hypothetical recursive struct with just two members/properties, a depth of 6
results in 63 (2^6-1) child values printed. In practice, data types commonly have more
than two fields, and so hundred of child values can be printed. An output of only 63
would be closer to a best case scenario. This doesn't factor in lldb's data output
syntax, which adds additional non-data lines to the output.

When all children must be shown, frame variable and expression both support the -A
(--show-all-children) flag.

rdar://145327522
@kastiglione kastiglione requested a review from a team as a code owner May 14, 2025 17:32
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione requested a review from adrian-prantl May 14, 2025 17:33
@kastiglione
Copy link
Author

See also llvm#139826

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test windows

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.

2 participants