Skip to content

Commit f725ad7

Browse files
committed
more robust tuple summary
1 parent 4f59533 commit f725ad7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/etc/lldb_providers.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
from typing import List
23

34
from lldb import (
45
SBData,
@@ -710,9 +711,18 @@ def get_type_name(self) -> str:
710711

711712

712713
def TupleSummaryProvider(valobj: SBValue, _dict: LLDBOpaque):
713-
output: str = sequence_formatter("(", valobj, dict)
714-
output += ")"
715-
return output
714+
output: List[str] = []
715+
716+
for i in range(0, valobj.GetNumChildren()):
717+
child: SBValue = valobj.GetChildAtIndex(i)
718+
summary = child.summary
719+
if summary is None:
720+
summary = child.value
721+
if summary is None:
722+
summary = "{...}"
723+
output.append(summary)
724+
725+
return "(" + ", ".join(output) + ")"
716726

717727

718728
class StdVecSyntheticProvider:

0 commit comments

Comments
 (0)