Home | History | Annotate | Download | only in formatters
      1 import lldb
      2 class jasSynthProvider:
      3      def __init__(self, valobj, dict):
      4          self.valobj = valobj;
      5      def num_children(self):
      6          return 2;
      7      def get_child_at_index(self, index):
      8          child = None
      9          if index == 0:
     10              child = self.valobj.GetChildMemberWithName('A');
     11          if index == 1:
     12              child = self.valobj.CreateValueFromExpression('X', '(int)1')
     13          return child;
     14      def get_child_index(self, name):
     15          if name == 'A':
     16              return 0;
     17          if name == 'X':
     18              return 1;
     19          return None;
     20 
     21 def __lldb_init_module(debugger,dict):
     22      debugger.CreateCategory("JASSynth").AddTypeSynthetic(lldb.SBTypeNameSpecifier("JustAStruct"),
     23         lldb.SBTypeSynthetic.CreateWithClassName("jas_synth.jasSynthProvider"))
     24 
     25