From a37a065c3392ab52abd6a896ac1e95b4878cafad Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Sun, 24 Jul 2011 00:14:56 +0000 Subject: Python synthetic children: - you can now define a Python class as a synthetic children producer for a type the class must adhere to this "interface": def __init__(self, valobj, dict): def get_child_at_index(self, index): def get_child_index(self, name): then using type synth add -l className typeName (e.g. type synth add -l fooSynthProvider foo) (This is still WIP with lots to be added) A small test case is available also as reference llvm-svn: 135865 --- .../data-formatter-python-synth/fooSynthProvider.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lldb/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py (limited to 'lldb/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py') diff --git a/lldb/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py new file mode 100644 index 00000000000..add34074fb0 --- /dev/null +++ b/lldb/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py @@ -0,0 +1,16 @@ +class fooSynthProvider: + def __init__(self, valobj, dict): + self.valobj = valobj; + def num_children(self): + return 2; + def get_child_at_index(self, index): + if index == 1: + child = self.valobj.GetChildMemberWithName('a'); + else: + child = self.valobj.GetChildMemberWithName('r'); + return child; + def get_child_index(self, name): + if name == 'a': + return 1; + else: + return 0; \ No newline at end of file -- cgit v1.2.3