]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / data-formatter / data-formatter-python-synth / ftsp.py
1 import lldb
2
3 counter = 0
4
5 class ftsp:
6         def __init__(self, valobj, dict):
7                 self.valobj = valobj;
8         def num_children(self):
9                 if self.char.IsValid():
10                         return 5;
11                 return 0;
12         def get_child_index(self,name):
13                 return 0;
14         def get_child_at_index(self,index):
15                 if index == 0:
16                         return self.x.Cast(self.char)
17                 if index == 4:
18                         return self.valobj.CreateValueFromExpression(str(index),'(char)('+str(self.count)+')')
19                 return self.x.CreateChildAtOffset(str(index),
20                                                                            index,
21                                                                            self.char);
22         def update(self):
23                 self.x = self.valobj.GetChildMemberWithName('x');
24                 self.char = self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar)
25                 global counter
26                 self.count = counter
27                 counter = counter + 1
28                 return True # important: if we return False here, or fail to return, the test will fail
29
30 def __lldb_init_module(debugger, dict):
31         global counter
32         counter = 0