Skip to content

Commit 45d1cca

Browse files
authored
[llvm][utils] Fix SmallString summary provider (llvm#78527)
Fixes `SmallString` summary provider, which was incorrectly producing the empty string. Initially I thought the strings I was debugging were empty for unknown reasons, but that was not the case.
1 parent 2663d2c commit 45d1cca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/utils/lldbDataFormatters.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,14 @@ def get_child_at_index(self, index):
218218

219219

220220
def SmallStringSummaryProvider(valobj, internal_dict):
221-
num_elements = valobj.GetNumChildren()
221+
# The underlying SmallVector base class is the first child.
222+
vector = valobj.GetChildAtIndex(0)
223+
num_elements = vector.GetNumChildren()
222224
res = '"'
223-
for i in range(0, num_elements):
224-
c = valobj.GetChildAtIndex(i).GetValue()
225+
for i in range(num_elements):
226+
c = vector.GetChildAtIndex(i)
225227
if c:
226-
res += c.strip("'")
228+
res += chr(c.GetValueAsUnsigned())
227229
res += '"'
228230
return res
229231

0 commit comments

Comments
 (0)