Files
clang-p2996/lldb/test/python_api/formatters/jas_synth.py
Enrico Granata 1422d6760c adding a new test case for the SB formatters API
llvm-svn: 150559
2012-02-15 02:36:32 +00:00

24 lines
776 B
Python

import lldb
class jasSynthProvider:
def __init__(self, valobj, dict):
self.valobj = valobj;
def num_children(self):
return 2;
def get_child_at_index(self, index):
if index == 0:
child = self.valobj.GetChildMemberWithName('A');
if index == 1:
child = self.valobj.CreateValueFromExpression('X', '(int)1')
return child;
def get_child_index(self, name):
if name == 'A':
return 0;
if name == 'X':
return 1;
return 2;
def __lldb_init_module(debugger,dict):
debugger.CreateCategory("JASSynth").AddTypeSynthetic(lldb.SBTypeNameSpecifier("JustAStruct"),
lldb.SBTypeSynthetic.CreateWithClassName("jas_synth.jasSynthProvider"))