Skip to content

Commit d077c2d

Browse files
authored
[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
1 parent 796a0a5 commit d077c2d

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
@@ -123,7 +123,7 @@ let Definition = "target" in {
123123
DefaultUnsignedValue<256>,
124124
Desc<"Maximum number of children to expand in any level of depth.">;
125125
def MaxChildrenDepth: Property<"max-children-depth", "UInt64">,
126-
DefaultUnsignedValue<6>,
126+
DefaultUnsignedValue<4>,
127127
Desc<"Maximum depth to expand children.">;
128128
def MaxSummaryLength: Property<"max-string-summary-length", "UInt64">,
129129
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
@@ -357,13 +357,13 @@ def cleanup():
357357
self.runCmd("type format delete int")
358358

359359
# First, check the following:
360-
# 1. Verify the default max-children-depth (6) is applied
360+
# 1. Verify the default max-children-depth (4) is applied
361361
# 2. Ensure the one-time warning is printed
362362
warning = "*** Some of the displayed variables have a greater depth"
363363
self.expect(
364364
"frame variable quite_nested",
365365
matching=True,
366-
substrs=["six ={...}", warning],
366+
substrs=["four ={...}", warning],
367367
)
368368
self.expect(
369369
"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)