39 lines · python
1import lldb2 3counter = 04 5 6class ftsp:7 def __init__(self, valobj, dict):8 self.valobj = valobj9 10 def num_children(self):11 if self.char.IsValid():12 return 513 return 014 15 def get_child_index(self, name):16 return 017 18 def get_child_at_index(self, index):19 if index == 0:20 return self.x.Cast(self.char)21 if index == 4:22 return self.valobj.CreateValueFromExpression(23 str(index), "(char)(" + str(self.count) + ")"24 )25 return self.x.CreateChildAtOffset(str(index), index, self.char)26 27 def update(self):28 self.x = self.valobj.GetChildMemberWithName("x")29 self.char = self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar)30 global counter31 self.count = counter32 counter = counter + 133 return True # important: if we return False here, or fail to return, the test will fail34 35 36def __lldb_init_module(debugger, dict):37 global counter38 counter = 039