4 class jasSynthProvider
:
5 def __init__(self
, valobj
, dict):
8 def num_children(self
):
11 def get_child_at_index(self
, index
):
14 child
= self
.valobj
.GetChildMemberWithName("A")
16 child
= self
.valobj
.CreateValueFromExpression("X", "(int)1")
19 def get_child_index(self
, name
):
27 def ccc_summary(sbvalue
, internal_dict
):
28 sbvalue
= sbvalue
.GetNonSyntheticValue()
29 # This tests that the SBValue.GetNonSyntheticValue() actually returns a
30 # non-synthetic value. If it does not, then sbvalue.GetChildMemberWithName("a")
31 # in the following statement will call the 'get_child_index' method of the
32 # synthetic child provider CCCSynthProvider below (which raises an
34 return "CCC object with leading value " + str(sbvalue
.GetChildMemberWithName("a"))
37 class CCCSynthProvider(object):
38 def __init__(self
, sbvalue
, internal_dict
):
39 self
._sbvalue
= sbvalue
41 def num_children(self
):
44 def get_child_index(self
, name
):
45 raise RuntimeError("I don't want to be called!")
47 def get_child_at_index(self
, index
):
49 return self
._sbvalue
.GetChildMemberWithName("a")
51 return self
._sbvalue
.GetChildMemberWithName("b")
53 return self
._sbvalue
.GetChildMemberWithName("c")
56 def empty1_summary(sbvalue
, internal_dict
):
57 return "I am an empty Empty1"
60 class Empty1SynthProvider(object):
61 def __init__(self
, sbvalue
, internal_dict
):
62 self
._sbvalue
= sbvalue
64 def num_children(self
):
67 def get_child_at_index(self
, index
):
71 def empty2_summary(sbvalue
, internal_dict
):
72 return "I am an empty Empty2"
75 class Empty2SynthProvider(object):
76 def __init__(self
, sbvalue
, internal_dict
):
77 self
._sbvalue
= sbvalue
79 def num_children(self
):
82 def get_child_at_index(self
, index
):
86 def __lldb_init_module(debugger
, dict):
87 debugger
.CreateCategory("JASSynth").AddTypeSynthetic(
88 lldb
.SBTypeNameSpecifier("JustAStruct"),
89 lldb
.SBTypeSynthetic
.CreateWithClassName("synth.jasSynthProvider"),
91 cat
= debugger
.CreateCategory("CCCSynth")
93 lldb
.SBTypeNameSpecifier("CCC"),
94 lldb
.SBTypeSynthetic
.CreateWithClassName(
95 "synth.CCCSynthProvider", lldb
.eTypeOptionCascade
99 lldb
.SBTypeNameSpecifier("CCC"),
100 lldb
.SBTypeSummary
.CreateWithFunctionName(
101 "synth.ccc_summary", lldb
.eTypeOptionCascade
104 cat
.AddTypeSynthetic(
105 lldb
.SBTypeNameSpecifier("Empty1"),
106 lldb
.SBTypeSynthetic
.CreateWithClassName("synth.Empty1SynthProvider"),
109 lldb
.SBTypeNameSpecifier("Empty1"),
110 lldb
.SBTypeSummary
.CreateWithFunctionName("synth.empty1_summary"),
112 cat
.AddTypeSynthetic(
113 lldb
.SBTypeNameSpecifier("Empty2"),
114 lldb
.SBTypeSynthetic
.CreateWithClassName("synth.Empty2SynthProvider"),
117 lldb
.SBTypeNameSpecifier("Empty2"),
118 lldb
.SBTypeSummary
.CreateWithFunctionName(
119 "synth.empty2_summary", lldb
.eTypeOptionHideEmptyAggregates