Skip to content

Commit 40c3fdc

Browse files
committed
[lldb] Reduce max-children-depth default for readability (#10683)
* [lldb] Reduce max-children-depth default for readability 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 * Fix tests for max-children-depth * Fix test/Shell/SymbolFile/PDB/udt-layout.test (cherry-picked from commit d077c2d)
1 parent cb0af45 commit 40c3fdc

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

lldb/source/Target/TargetProperties.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let Definition = "target" in {
129129
DefaultUnsignedValue<24>,
130130
Desc<"Maximum number of children to expand in any level of depth.">;
131131
def MaxChildrenDepth: Property<"max-children-depth", "UInt64">,
132-
DefaultUnsignedValue<6>,
132+
DefaultUnsignedValue<4>,
133133
Desc<"Maximum depth to expand children.">;
134134
def MaxSummaryLength: Property<"max-string-summary-length", "UInt64">,
135135
DefaultUnsignedValue<1024>,

lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,13 @@ def cleanup():
359359
self.runCmd("type format delete int")
360360

361361
# First, check the following:
362-
# 1. Verify the default max-children-depth (6) is applied
362+
# 1. Verify the default max-children-depth (4) is applied
363363
# 2. Ensure the one-time warning is printed
364364
warning = "*** Some of the displayed variables have a greater depth"
365365
self.expect(
366366
"frame variable quite_nested",
367367
matching=True,
368-
substrs=["six ={...}", warning],
368+
substrs=["four ={...}", warning],
369369
)
370370
self.expect(
371371
"frame variable quite_nested",

lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def cleanup():
120120
'@"2 elements"',
121121
],
122122
)
123+
124+
self.runCmd("settings set target.max-children-depth 6")
123125
self.expect(
124126
"frame variable mutabledict --ptr-depth 3",
125127
substrs=[

lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
settings set target.max-children-depth 6
12
breakpoint set --file UdtLayoutTest.cpp --line 60
23
run
34
target variable

0 commit comments

Comments
 (0)