From 554bd0996872ffcadf808229cc38e445d6016dae Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 11 Jul 2019 21:38:25 -0700 Subject: label offset computation still has a bug I changed the test a little to make it obvious. Basically there's no way we can compute the segment offset correctly without knowing the segment name in the previous assertion. --- subx/apps/survey.subx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'subx/apps') diff --git a/subx/apps/survey.subx b/subx/apps/survey.subx index abdd6939..0cedd7bc 100644 --- a/subx/apps/survey.subx +++ b/subx/apps/survey.subx @@ -671,6 +671,7 @@ test-compute-offsets: # == code 0x1 # ab x/imm32 # == data 0x1000 + # 00 # x: # 34 # @@ -679,8 +680,8 @@ test-compute-offsets: # segment 'code' has size 0x5 # segment 'data' is at file offset 0x5 # label 'x' is in segment 'data' - # label 'x' is at segment offset 0x0 - # segment 'data' has size 0x1 + # label 'x' is at segment offset 0x1 + # segment 'data' has size 0x2 # # . prolog 55/push-EBP @@ -805,10 +806,10 @@ test-compute-offsets: e8/call check-trace-contains/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . check-trace-contains("segment 'data' has size 0x00000001.", msg) + # . check-trace-contains("segment 'data' has size 0x00000002.", msg) # . . push args 68/push "F - test-compute-offsets/3"/imm32 - 68/push "segment 'data' has size 0x00000001."/imm32 + 68/push "segment 'data' has size 0x00000002."/imm32 # . . call e8/call check-trace-contains/disp32 # . . discard args @@ -821,10 +822,10 @@ test-compute-offsets: e8/call check-trace-contains/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP - # . check-trace-contains("label 'x' is at segment offset 0x00000000.", msg) + # . check-trace-contains("label 'x' is at segment offset 0x00000001.", msg) # . . push args 68/push "F - test-compute-offsets/5"/imm32 - 68/push "label 'x' is at segment offset 0x00000000."/imm32 + 68/push "label 'x' is at segment offset 0x00000001."/imm32 # . . call e8/call check-trace-contains/disp32 # . . discard args -- cgit 1.4.1-2-gfad0 NSE?id=5b57fd2e6418931a3be5274bd4ee20f5ebfefa3d'>LICENSE
blob: d921d3dffef3939870f5eaa4ce69ac9a308ac2df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214