Skip to content

[lldb] Fix ForwardListFrontEnd::CalculateNumChildren #139805

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 1 commit into
base: main
Choose a base branch
from
Open
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/Plugins/Language/CPlusPlus/LibCxxList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ llvm::Expected<uint32_t> ForwardListFrontEnd::CalculateNumChildren() {

ListEntry current(m_head);
m_count = 0;
while (current && m_count < m_list_capping_size) {
while (current) {
++m_count;
current = current.next();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ def do_test(self, stdlib_type):
substrs=["target.max-children-count (unsigned) = 256"],
)

self.runCmd("settings set target.max-children-count 256", check=False)
self.expect(
"frame variable thousand_elts",
matching=False,
substrs=["[256]", "[333]", "[444]", "[555]", "[666]", "..."],
substrs=["[256]", "[333]", "[444]", "[555]", "[666]"],
)
self.runCmd("settings set target.max-children-count 3", check=False)

self.runCmd("settings set target.max-children-count 3", check=False)
self.expect(
"frame variable thousand_elts",
matching=False,
Expand All @@ -73,7 +74,7 @@ def do_test(self, stdlib_type):
self.expect(
"frame variable thousand_elts",
matching=True,
substrs=["size=256", "[0]", "[1]", "[2]", "..."],
substrs=["size=1000", "[0]", "[1]", "[2]", "..."],
)

def do_test_ptr_and_ref(self, stdlib_type):
Expand Down Expand Up @@ -138,7 +139,7 @@ def do_test_ptr_and_ref(self, stdlib_type):
"frame variable ref",
matching=True,
substrs=[
"size=256",
"size=1000",
"[0] = 999",
"[1] = 998",
"[2] = 997",
Expand All @@ -149,7 +150,7 @@ def do_test_ptr_and_ref(self, stdlib_type):
"frame variable *ptr",
matching=True,
substrs=[
"size=256",
"size=1000",
"[0] = 999",
"[1] = 998",
"[2] = 997",
Expand Down
Loading