Skip to content

Commit beeb0d9

Browse files
committed
[lldb] Fix ForwardListFrontEnd::CalculateNumChildren
Fixes the calculation of the number of children for `std::forward_list` to no longer be capped. The calculation was capped by the value of `target.max-children-count`. This resulted in at least the following problems: 1. The summary formatter would display the incorrect size when the size was greater than `max-child-count`. 2. The elision marker (`...`) would not be shown when the number of elements was greater than `max-child-count`.
1 parent 298ace7 commit beeb0d9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ llvm::Expected<uint32_t> ForwardListFrontEnd::CalculateNumChildren() {
251251

252252
ListEntry current(m_head);
253253
m_count = 0;
254-
while (current && m_count < m_list_capping_size) {
254+
while (current) {
255255
++m_count;
256256
current = current.next();
257257
}

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/forward_list/TestDataFormatterGenericForwardList.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ def do_test(self, stdlib_type):
5353
substrs=["target.max-children-count (unsigned) = 256"],
5454
)
5555

56+
self.runCmd("settings set target.max-children-count 256", check=False)
5657
self.expect(
5758
"frame variable thousand_elts",
5859
matching=False,
59-
substrs=["[256]", "[333]", "[444]", "[555]", "[666]", "..."],
60+
substrs=["[256]", "[333]", "[444]", "[555]", "[666]"],
6061
)
61-
self.runCmd("settings set target.max-children-count 3", check=False)
6262

63+
self.runCmd("settings set target.max-children-count 3", check=False)
6364
self.expect(
6465
"frame variable thousand_elts",
6566
matching=False,
@@ -73,7 +74,7 @@ def do_test(self, stdlib_type):
7374
self.expect(
7475
"frame variable thousand_elts",
7576
matching=True,
76-
substrs=["size=256", "[0]", "[1]", "[2]", "..."],
77+
substrs=["size=1000", "[0]", "[1]", "[2]", "..."],
7778
)
7879

7980
def do_test_ptr_and_ref(self, stdlib_type):
@@ -138,7 +139,7 @@ def do_test_ptr_and_ref(self, stdlib_type):
138139
"frame variable ref",
139140
matching=True,
140141
substrs=[
141-
"size=256",
142+
"size=1000",
142143
"[0] = 999",
143144
"[1] = 998",
144145
"[2] = 997",
@@ -149,7 +150,7 @@ def do_test_ptr_and_ref(self, stdlib_type):
149150
"frame variable *ptr",
150151
matching=True,
151152
substrs=[
152-
"size=256",
153+
"size=1000",
153154
"[0] = 999",
154155
"[1] = 998",
155156
"[2] = 997",

0 commit comments

Comments
 (0)