@@ -11,121 +11,161 @@ class TestSwiftEmbeddedFrameVariable(TestBase):
11
11
def test (self ):
12
12
self .build ()
13
13
14
- target , process , _ , _ = lldbutil .run_to_source_breakpoint (
14
+ target , process , thread , _ = lldbutil .run_to_source_breakpoint (
15
15
self , "break here" , lldb .SBFileSpec ("main.swift" )
16
16
)
17
+ frame = thread .frames [0 ]
18
+ self .assertTrue (frame , "Frame 0 is valid." )
17
19
18
- self .expect (
19
- "frame variable varB" ,
20
- substrs = ["varB = " , "a = (field = 4.2000000000000002)" , "b = 123456" ],
21
- )
22
- self .expect (
23
- "frame variable tuple" ,
24
- substrs = [
25
- "(a.A, a.B) tuple = {" ,
26
- "0 = (field = 4.2000000000000002)" ,
27
- "1 = {" ,
28
- "a = (field = 4.2000000000000002)" ,
29
- "b = 123456" ,
30
- ],
31
- )
20
+ varB = frame .FindVariable ("varB" )
21
+ field = varB .GetChildMemberWithName ("a" ).GetChildMemberWithName ("field" )
22
+ lldbutil .check_variable (self , field , False , value = '4.5' )
23
+ b = varB .GetChildMemberWithName ("b" )
24
+ lldbutil .check_variable (self , b , False , value = '123456' )
32
25
33
- self .expect (
34
- "frame variable nonPayload1" , substrs = ["NonPayloadEnum) nonPayload1 = one" ]
35
- )
36
- self .expect (
37
- "frame variable nonPayload2" , substrs = ["NonPayloadEnum) nonPayload2 = two" ]
38
- )
39
- self .expect (
40
- "frame variable singlePayload" ,
41
- substrs = [
42
- "SinglePayloadEnum) singlePayload = " ,
43
- "payload {" ,
44
- "a = (field = 4.2000000000000002)" ,
45
- "b = 123456" ,
46
- ],
47
- )
48
- self .expect (
49
- "frame variable emptySinglePayload" ,
50
- substrs = ["SinglePayloadEnum) emptySinglePayload = nonPayloadTwo" ],
51
- )
26
+ tuple = frame .FindVariable ("tuple" )
27
+ first = tuple .GetChildAtIndex (0 )
28
+ field = first .GetChildMemberWithName ("field" )
29
+ lldbutil .check_variable (self , field , False , value = '4.5' )
30
+ second = tuple .GetChildAtIndex (1 )
31
+ a = second .GetChildMemberWithName ("a" )
32
+ field = a .GetChildMemberWithName ("field" )
33
+ lldbutil .check_variable (self , field , False , value = '4.5' )
34
+ b = second .GetChildMemberWithName ("b" )
35
+ lldbutil .check_variable (self , b , False , value = '123456' )
52
36
53
- self .expect (
54
- "frame variable smallMultipayloadEnum1" ,
55
- substrs = [
56
- "SmallMultipayloadEnum) smallMultipayloadEnum1 = one {" ,
57
- "one = two" ,
58
- ],
59
- )
60
- self .expect (
61
- "frame variable smallMultipayloadEnum2" ,
62
- substrs = [
63
- "SmallMultipayloadEnum) smallMultipayloadEnum2 = two {" ,
64
- "two = one" ,
65
- ],
66
- )
67
- self .expect (
68
- "frame variable bigMultipayloadEnum1" ,
69
- substrs = [
70
- "BigMultipayloadEnum) bigMultipayloadEnum1 = one {" ,
71
- "0 = " ,
72
- "(supField = 42)" ,
73
- "1 = " ,
74
- "(supField = 43)" ,
75
- "2 = " ,
76
- "(supField = 44)" ,
77
- ],
78
- )
37
+ nonPayload1 = frame .FindVariable ("nonPayload1" )
38
+ lldbutil .check_variable (self , nonPayload1 , False , value = 'one' )
79
39
80
- self .expect (
81
- "frame variable fullMultipayloadEnum1" ,
82
- substrs = ["FullMultipayloadEnum) fullMultipayloadEnum1 = " , "(one = 120)" ],
83
- )
84
- self .expect (
85
- "frame variable fullMultipayloadEnum2" ,
86
- substrs = [
87
- "FullMultipayloadEnum) fullMultipayloadEnum2 = " ,
88
- "(two = 9.2100000000000008)" ,
89
- ],
90
- )
40
+ nonPayload2 = frame .FindVariable ("nonPayload2" )
41
+ lldbutil .check_variable (self , nonPayload2 , False , value = 'two' )
91
42
92
- self .expect (
93
- "frame variable bigFullMultipayloadEnum1" ,
94
- substrs = [
95
- "a.BigFullMultipayloadEnum) bigFullMultipayloadEnum1 = one {" ,
96
- "one = (0 = 209, 1 = 315)" ,
97
- ],
98
- )
99
- self .expect (
100
- "frame variable bigFullMultipayloadEnum2" ,
101
- substrs = [
102
- "a.BigFullMultipayloadEnum) bigFullMultipayloadEnum2 = two {" ,
103
- "two = (0 = 452.19999999999999, 1 = 753.89999999999998)" ,
104
- ],
105
- )
43
+ singlePayload = frame .FindVariable ("singlePayload" )
44
+ payload = singlePayload .GetChildMemberWithName ('payload' )
45
+ field = payload .GetChildMemberWithName ('a' ).GetChildMemberWithName ('field' )
46
+ lldbutil .check_variable (self , field , False , value = '4.5' )
47
+ b = payload .GetChildMemberWithName ('b' )
48
+ lldbutil .check_variable (self , b , False , value = '123456' )
106
49
107
- self .expect ("frame variable sup" , substrs = ["Sup) sup = " , "supField = 42" ])
108
- self .expect (
109
- "frame variable sub" ,
110
- substrs = [
111
- "Sub) sub = " ,
112
- "Sup = {" ,
113
- "supField = 42" ,
114
- "subField = {" ,
115
- "a = (field = 4.2000000000000002" ,
116
- "b = 123456" ,
117
- ],
118
- )
119
- self .expect (
120
- "frame variable subSub" ,
121
- substrs = [
122
- "SubSub) subSub =" ,
123
- "a.Sub = {" ,
124
- "a.Sup = {" ,
125
- "supField = 42" ,
126
- "subField = {" ,
127
- "a = (field = 4.2000000000000002" ,
128
- "b = 123456" ,
129
- "subSubField = (field = 4.2000000000000002)" ,
130
- ],
131
- )
50
+ emptySinglePayload = frame .FindVariable ("emptySinglePayload" )
51
+ lldbutil .check_variable (self , emptySinglePayload , False , value = 'nonPayloadTwo' )
52
+
53
+ smallMultipayloadEnum1 = frame .FindVariable ("smallMultipayloadEnum1" )
54
+ one = smallMultipayloadEnum1 .GetChildMemberWithName ("one" )
55
+ lldbutil .check_variable (self , one , False , value = 'two' )
56
+
57
+ smallMultipayloadEnum2 = frame .FindVariable ("smallMultipayloadEnum2" )
58
+ two = smallMultipayloadEnum2 .GetChildMemberWithName ("two" )
59
+ lldbutil .check_variable (self , two , False , value = 'one' )
60
+
61
+
62
+ bigMultipayloadEnum1 = frame .FindVariable ("bigMultipayloadEnum1" )
63
+ one = bigMultipayloadEnum1 .GetChildMemberWithName ("one" )
64
+ first = one .GetChildAtIndex (0 ).GetChildMemberWithName ("supField" )
65
+ second = one .GetChildAtIndex (1 ).GetChildMemberWithName ("supField" )
66
+ third = one .GetChildAtIndex (2 ).GetChildMemberWithName ("supField" )
67
+ lldbutil .check_variable (self , first , False , value = '42' )
68
+ lldbutil .check_variable (self , second , False , value = '43' )
69
+ lldbutil .check_variable (self , third , False , value = '44' )
70
+
71
+
72
+ fullMultipayloadEnum1 = frame .FindVariable ("fullMultipayloadEnum1" )
73
+ one = fullMultipayloadEnum1 .GetChildMemberWithName ("one" )
74
+ lldbutil .check_variable (self , one , False , value = '120' )
75
+
76
+ fullMultipayloadEnum2 = frame .FindVariable ("fullMultipayloadEnum2" )
77
+ two = fullMultipayloadEnum2 .GetChildMemberWithName ("two" )
78
+ lldbutil .check_variable (self , two , False , value = '9.5' )
79
+
80
+ bigFullMultipayloadEnum1 = frame .FindVariable ("bigFullMultipayloadEnum1" )
81
+ one = bigFullMultipayloadEnum1 .GetChildMemberWithName ("one" )
82
+ first = one .GetChildAtIndex (0 )
83
+ second = one .GetChildAtIndex (1 )
84
+ lldbutil .check_variable (self , first , False , value = '209' )
85
+ lldbutil .check_variable (self , second , False , value = '315' )
86
+
87
+ bigFullMultipayloadEnum2 = frame .FindVariable ("bigFullMultipayloadEnum2" )
88
+ two = bigFullMultipayloadEnum2 .GetChildMemberWithName ("two" )
89
+ first = two .GetChildAtIndex (0 )
90
+ second = two .GetChildAtIndex (1 )
91
+ lldbutil .check_variable (self , first , False , value = '452.5' )
92
+ lldbutil .check_variable (self , second , False , value = '753.5' )
93
+
94
+
95
+ sup = frame .FindVariable ("sup" )
96
+ supField = sup .GetChildMemberWithName ("supField" )
97
+ lldbutil .check_variable (self , supField , False , value = '42' )
98
+
99
+ sub = frame .FindVariable ("sub" )
100
+ supField = sub .GetChildMemberWithName ("supField" )
101
+ lldbutil .check_variable (self , supField , False , value = '42' )
102
+ subField = sub .GetChildMemberWithName ("subField" )
103
+ a = subField .GetChildMemberWithName ("a" )
104
+ field = a .GetChildMemberWithName ("field" )
105
+ lldbutil .check_variable (self , field , False , value = '4.5' )
106
+ b = subField .GetChildMemberWithName ("b" )
107
+ lldbutil .check_variable (self , b , False , value = '123456' )
108
+
109
+ subSub = frame .FindVariable ("subSub" )
110
+ supField = subSub .GetChildMemberWithName ("supField" )
111
+ lldbutil .check_variable (self , supField , False , value = '42' )
112
+ subField = subSub .GetChildMemberWithName ("subField" )
113
+ a = subField .GetChildMemberWithName ("a" )
114
+ field = a .GetChildMemberWithName ("field" )
115
+ lldbutil .check_variable (self , field , False , value = '4.5' )
116
+ b = subField .GetChildMemberWithName ("b" )
117
+ lldbutil .check_variable (self , b , False , value = '123456' )
118
+
119
+ subSubField = subSub .GetChildMemberWithName ("subSubField" ).GetChildMemberWithName ("field" )
120
+ lldbutil .check_variable (self , subSubField , False , value = '4.5' )
121
+
122
+ gsp = frame .FindVariable ("gsp" )
123
+ t = gsp .GetChildMemberWithName ("t" )
124
+ lldbutil .check_variable (self , t , False , value = '42' )
125
+ u = gsp .GetChildMemberWithName ("u" )
126
+ lldbutil .check_variable (self , u , False , value = '94.5' )
127
+
128
+ gsp2 = frame .FindVariable ("gsp2" )
129
+ t = gsp2 .GetChildMemberWithName ("t" )
130
+ supField = t .GetChildMemberWithName ("supField" )
131
+ lldbutil .check_variable (self , supField , False , value = '42' )
132
+ u = gsp2 .GetChildMemberWithName ("u" )
133
+ a = u .GetChildMemberWithName ("a" )
134
+ field = a .GetChildMemberWithName ("field" )
135
+ lldbutil .check_variable (self , field , False , value = '4.5' )
136
+ b = u .GetChildMemberWithName ("b" )
137
+ lldbutil .check_variable (self , b , False , value = '123456' )
138
+
139
+ gsp3 = frame .FindVariable ("gsp3" )
140
+ t = gsp3 .GetChildMemberWithName ("t" )
141
+ one = t .GetChildMemberWithName ("one" )
142
+ first = one .GetChildAtIndex (0 )
143
+ second = one .GetChildAtIndex (1 )
144
+ lldbutil .check_variable (self , first , False , value = '209' )
145
+ lldbutil .check_variable (self , second , False , value = '315' )
146
+ u = gsp3 .GetChildMemberWithName ("u" )
147
+ two = u .GetChildMemberWithName ("two" )
148
+ lldbutil .check_variable (self , two , False , value = 'one' )
149
+
150
+ gcp = frame .FindVariable ("gcp" )
151
+ t = gcp .GetChildMemberWithName ("t" )
152
+ lldbutil .check_variable (self , t , False , value = '55.5' )
153
+ u = gcp .GetChildMemberWithName ("u" )
154
+ lldbutil .check_variable (self , u , False , value = '9348' )
155
+
156
+
157
+ either = frame .FindVariable ("either" )
158
+ left = either .GetChildMemberWithName ("left" )
159
+ lldbutil .check_variable (self , left , False , value = '1234' )
160
+
161
+ either2 = frame .FindVariable ("either2" )
162
+ right = either2 .GetChildMemberWithName ("right" )
163
+ t = right .GetChildMemberWithName ("t" )
164
+ one = t .GetChildMemberWithName ("one" )
165
+ first = one .GetChildAtIndex (0 )
166
+ second = one .GetChildAtIndex (1 )
167
+ lldbutil .check_variable (self , first , False , value = '209' )
168
+ lldbutil .check_variable (self , second , False , value = '315' )
169
+ u = right .GetChildMemberWithName ("u" )
170
+ two = u .GetChildMemberWithName ("two" )
171
+ lldbutil .check_variable (self , two , False , value = 'one' )
0 commit comments