[llvm][utils] Fix SmallString summary provider (#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.
This commit is contained in:
Dave Lee 2024-01-18 10:35:18 -08:00 committed by GitHub
parent 2663d2cb9c
commit 45d1cca339
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -218,12 +218,14 @@ class OptionalSynthProvider:
def SmallStringSummaryProvider(valobj, internal_dict):
num_elements = valobj.GetNumChildren()
# The underlying SmallVector base class is the first child.
vector = valobj.GetChildAtIndex(0)
num_elements = vector.GetNumChildren()
res = '"'
for i in range(0, num_elements):
c = valobj.GetChildAtIndex(i).GetValue()
for i in range(num_elements):
c = vector.GetChildAtIndex(i)
if c:
res += c.strip("'")
res += chr(c.GetValueAsUnsigned())
res += '"'
return res