@@ -205,6 +205,24 @@ def StdPathSummaryProvider(valobj: SBValue, _dict: LLDBOpaque) -> str:
205
205
return '"%s"' % data
206
206
207
207
208
+ def sequence_formatter (output : str , valobj : SBValue , _dict : LLDBOpaque ):
209
+ length : int = valobj .GetNumChildren ()
210
+
211
+ long : bool = False
212
+ for i in range (0 , length ):
213
+ if len (output ) > 32 :
214
+ long = True
215
+ break
216
+ child : SBValue = valobj .GetChildAtIndex (i )
217
+ output += f"{ child .value } , "
218
+ if long :
219
+ output = f"(len: { length } ) " + output + "..."
220
+ else :
221
+ output = output [:- 2 ]
222
+
223
+ return output
224
+
225
+
208
226
class StructSyntheticProvider :
209
227
"""Pretty-printer for structs and struct enum variants"""
210
228
@@ -348,6 +366,41 @@ def has_children(self) -> bool:
348
366
return True
349
367
350
368
369
+ class MSVCTupleSyntheticProvider :
370
+ __slots__ = ["valobj" ]
371
+
372
+ def __init__ (self , valobj : SBValue , _dict : LLDBOpaque ):
373
+ self .valobj = valobj
374
+
375
+ def num_children (self ) -> int :
376
+ return self .valobj .GetNumChildren ()
377
+
378
+ def get_child_index (self , name : str ) -> int :
379
+ return self .valobj .GetIndexOfChildWithName (name )
380
+
381
+ def get_child_at_index (self , index : int ) -> SBValue :
382
+ child : SBValue = self .valobj .GetChildAtIndex (index )
383
+ return child .CreateChildAtOffset (str (index ), 0 , child .GetType ())
384
+
385
+ def update (self ):
386
+ pass
387
+
388
+ def has_children (self ) -> bool :
389
+ return self .valobj .MightHaveChildren ()
390
+
391
+ def get_type_name (self ) -> str :
392
+ name = self .valobj .GetTypeName ()
393
+ # remove "tuple$<" and ">", str.removeprefix and str.removesuffix require python 3.9+
394
+ name = name [7 :- 1 ]
395
+ return "(" + name + ")"
396
+
397
+
398
+ def TupleSummaryProvider (valobj : SBValue , _dict : LLDBOpaque ):
399
+ output : str = sequence_formatter ("(" , valobj , dict )
400
+ output += ")"
401
+ return output
402
+
403
+
351
404
class StdVecSyntheticProvider :
352
405
"""Pretty-printer for alloc::vec::Vec<T>
353
406
0 commit comments