Skip to content

[lldb] Reduce max-children-count default to readable size #139826

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/source/Target/TargetProperties.td
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let Definition = "target" in {
DefaultUnsignedValue<6>,
Desc<"The maximum number of zeroes to insert when displaying a very small float before falling back to scientific notation.">;
def MaxChildrenCount: Property<"max-children-count", "UInt64">,
DefaultUnsignedValue<256>,
DefaultUnsignedValue<24>,
Desc<"Maximum number of children to expand in any level of depth.">;
def MaxChildrenDepth: Property<"max-children-depth", "UInt64">,
DefaultUnsignedValue<0xFFFFFFFF>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_with_run_command(self):
def cleanup():
self.runCmd("type format clear", check=False)
self.runCmd("type summary clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)
self.runCmd("settings set target.max-children-count 24", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def do_test(self, stdlib_type):
self.expect(
"settings show target.max-children-count",
matching=True,
substrs=["target.max-children-count (unsigned) = 256"],
substrs=["target.max-children-count (unsigned) = 24"],
)

self.expect(
Expand All @@ -73,7 +73,7 @@ def do_test(self, stdlib_type):
self.expect(
"frame variable thousand_elts",
matching=True,
substrs=["size=256", "[0]", "[1]", "[2]", "..."],
substrs=["size=24", "[0]", "[1]", "[2]", "..."],
)

def do_test_ptr_and_ref(self, stdlib_type):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)
self.runCmd("settings set auto-one-line-summaries true", check=False)

# Execute the cleanup function during test case tear down.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

is_64_bit = self.process().GetAddressByteSize() == 8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)
self.runCmd("settings set target.max-children-count 24", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)

self.expect(
"frame variable vBool",
"frame variable -A vBool",
substrs=[
"size=49",
"[0] = false",
Expand All @@ -62,7 +62,7 @@ def cleanup():
)

self.expect(
"expr vBool",
"expr -A -- vBool",
substrs=[
"size=49",
"[0] = false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)

self.expect(
"frame variable vBool",
"frame variable -A vBool",
substrs=[
"size=49",
"[0] = false",
Expand All @@ -62,7 +61,7 @@ def cleanup():
)

self.expect(
"expr vBool",
"expr -A -- vBool",
substrs=[
"size=49",
"[0] = false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def cleanup():
self.runCmd("type summary clear", check=False)
self.runCmd("type filter clear", check=False)
self.runCmd("type synth clear", check=False)
self.runCmd("settings set target.max-children-count 256", check=False)
self.runCmd("settings set target.max-children-count 24", check=False)

# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
Expand All @@ -68,10 +68,10 @@ def cleanup():
"r = 34",
],
)
# num_children() should be called with at most max_num_children=257
# num_children() should be called with at most max_num_children=25
# (target.max-children-count + 1)
self.expect(
"script fooSynthProvider.reset_max_num_children_max()", substrs=["257"]
"script fooSynthProvider.reset_max_num_children_max()", substrs=["25"]
)

# check that capping works
Expand Down
Loading