@@ -74,10 +74,12 @@ Every trace step optionally contains the source location as an element.
74
74
``` {.xml}
75
75
<xs:element name="location">
76
76
<xs:complexType>
77
- <xs:attribute name="file" type="xs:string" use="optional"></xs:attribute>
78
- <xs:attribute name="line" type="xs:int" use="optional"></xs:attribute>
77
+ <xs:attribute name="file" type="xs:string" use="optional"/>
78
+ <xs:attribute name="line" type="xs:int" use="optional"/>
79
+ <xs:attribute name="column" type="xs:int" use="optional"/>
79
80
<xs:attribute name="working-directory" type="xs:string"
80
- use="optional"></xs:attribute>
81
+ use="optional"/>
82
+ <xs:attribute name="function" type="xs:string" use="optional"/>
81
83
</xs:complexType>
82
84
</xs:element>
83
85
```
@@ -88,14 +90,14 @@ Trace Steps in XML
88
90
The attributes ` hidden, thread, step_nr ` are common to all trace steps.
89
91
90
92
``` {.xml}
91
- <xs:attributeGroup name="traceStepAttrs"/ >
93
+ <xs:attributeGroup name="traceStepAttrs">
92
94
<xs:attribute name="hidden" type="xs:string"></xs:attribute>
93
95
<xs:attribute name="step_nr" type="xs:int"></xs:attribute>
94
96
<xs:attribute name="thread" type="xs:int"></xs:attribute>
95
97
</xs:attributeGroup>
96
98
```
97
99
98
- [ Assert] {} (element name: ` failure ` )
100
+ Assert (element name: ` failure ` )
99
101
100
102
** Attributes** :
101
103
@@ -127,14 +129,14 @@ The attributes `hidden, thread, step_nr` are common to all trace steps.
127
129
<xs:all>
128
130
<xs:element name="location" minOccurs="0"></xs:element>
129
131
</xs:all>
130
- <xs:attributeGroup ref="traceStepAttrs"/ >
132
+ <xs:attributeGroup ref="traceStepAttrs">
131
133
<xs:attribute name="property" type="xs:string"></xs:attribute>
132
134
<xs:attribute name="reason" type="xs:string"></xs:attribute>
133
135
</xs:complexType>
134
136
</xs:element>
135
137
```
136
138
137
- [ Assignment, Declaration] {} (element name: ` assignment ` )
139
+ Assignment, Declaration (element name: ` assignment ` )
138
140
139
141
** Attributes** :\
140
142
if the lhs symbol is known
@@ -143,7 +145,7 @@ if the lhs symbol is known
143
145
144
146
- ` identifier ` : string (symbol name)
145
147
146
- - ` base_name ` : string (e.g. “ counter” )
148
+ - ` base_name ` : string (e.g. " counter" )
147
149
148
150
- ` display_name ` : string (e.g. "main::1::counter")
149
151
@@ -160,7 +162,7 @@ always present
160
162
** Elements** :\
161
163
if the lhs symbol is known
162
164
163
- - ` type ` : C type (e.g. “ signed int” )
165
+ - ` type ` : C type (e.g. " signed int" )
164
166
165
167
always present
166
168
@@ -192,7 +194,7 @@ always present
192
194
<xs:element name="full_lhs" type="xs:string"></xs:element>
193
195
<xs:element name="full_lhs_value" type="xs:int"></xs:element>
194
196
</xs:all>
195
- <xs:attributeGroup ref="traceStepAttrs"/ >
197
+ <xs:attributeGroup ref="traceStepAttrs">
196
198
<xs:attribute name="assignment_type" type="xs:string"></xs:attribute>
197
199
<xs:attribute name="base_name" type="xs:string"
198
200
use="optional"></xs:attribute>
@@ -205,7 +207,7 @@ always present
205
207
</xs:element>
206
208
```
207
209
208
- [ Input] {} (element name: ` input ` )
210
+ Input (element name: ` input ` )
209
211
210
212
** Attributes** :
211
213
@@ -244,28 +246,22 @@ for each IO argument
244
246
** XSD** :
245
247
246
248
``` {.xml}
247
- <xs:group name="ioArgGroup">
248
- <xs:all>
249
- <xs:element name="value" type="xs:string"></xs:element>
250
- <xs:element name="value_expression">
251
- <xs:complexType></xs:complexType>
252
- </xs:element>
253
- </xs:all>
254
- </xs:group>
255
-
256
249
<xs:element name="input">
257
250
<xs:complexType>
258
- <xs:all>
259
- <xs:element name="location" minOccurs="0"></xs:element>
260
- <xs:element name="input_id" type="xs:string"></xs:element>
261
- <xs:group ref="ioArgGroup" maxOccurs="unbounded"></xs:element>
262
- </xs:all>
251
+ <xs:sequence>
252
+ <xs:element name="input_id" type="xs:string"/>
253
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
254
+ <xs:element name="value" type="xs:string"/>
255
+ <xs:element ref="value_expression"/>
256
+ </xs:sequence>
257
+ <xs:element ref="location" minOccurs="0"/>
258
+ </xs:sequence>
263
259
<xs:attributeGroup ref="traceStepAttrs"/>
264
260
</xs:complexType>
265
261
</xs:element>
266
262
```
267
263
268
- [ Output] {} (element name: ` output ` )
264
+ Output (element name: ` output ` )
269
265
270
266
** Attributes** :
271
267
@@ -281,12 +277,33 @@ for each IO argument
281
277
282
278
for each IO argument
283
279
284
- - ` value ` : the (correctly typed) value the input is initialised with
280
+ - ` text ` : The textual representation of the output
281
+
282
+ - ` location ` : The original source location of the output
283
+
284
+ - ` value ` : the (correctly typed) value of the object that is being
285
+ output
285
286
286
287
- ` value_expression ` : the internal representation of the value
287
288
288
- [ Function Call] {} (element name: ` function_call ` )\
289
- [ Function Return] {} (element name: ` function_return ` )
289
+ ``` {.xml}
290
+ <xs:element name="output">
291
+ <xs:complexType>
292
+ <xs:sequence>
293
+ <xs:element name="text" type="xs:string"/>
294
+ <xs:element ref="location" minOccurs="0"/>
295
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
296
+ <xs:element name="value" type="xs:string"/>
297
+ <xs:element ref="value_expression"/>
298
+ </xs:sequence>
299
+ </xs:sequence>
300
+ <xs:attributeGroup ref="traceStepAttrs"/>
301
+ </xs:complexType>
302
+ </xs:element>
303
+ ```
304
+
305
+ Function Call (element name: ` function_call ` )\
306
+ Function Return (element name: ` function_return ` )
290
307
291
308
** Attributes** :
292
309
@@ -309,6 +326,8 @@ for each IO argument
309
326
310
327
- ` location ` : source location of the called function
311
328
329
+ - ` function ` : The function that is being called/returned from.
330
+
312
331
** Example** :
313
332
314
333
``` {.xml}
@@ -327,10 +346,18 @@ for each IO argument
327
346
<xs:complexType>
328
347
<xs:all>
329
348
<xs:element name="location" minOccurs="0"></xs:element>
330
- <xs:element name="function">
331
- <!-- See below -->
332
- </xs:element>
349
+ <xs:element ref="function"/>
333
350
</xs:all>
351
+ <xs:attributeGroup ref="traceStepAttrs">
352
+ </xs:complexType>
353
+ </xs:element>
354
+
355
+ <xs:element name="function_return">
356
+ <xs:complexType>
357
+ <xs:sequence>
358
+ <xs:element ref="function"/>
359
+ <xs:element ref="location" minOccurs="0"/>
360
+ </xs:sequence>
334
361
<xs:attributeGroup ref="traceStepAttrs"/>
335
362
</xs:complexType>
336
363
</xs:element>
@@ -346,7 +373,7 @@ for each IO argument
346
373
</xs:element>
347
374
```
348
375
349
- [ All Other Steps] {} (element name: ` location-only ` )
376
+ All Other Steps (element name: ` location-only ` )
350
377
351
378
Only included if the source location exists and differs from the
352
379
previous one.\
@@ -378,7 +405,7 @@ previous one.\
378
405
<xs:all>
379
406
<xs:element name="location" minOccurs="0"></xs:element>
380
407
</xs:all>
381
- <xs:attributeGroup ref="traceStepAttrs"/ >
408
+ <xs:attributeGroup ref="traceStepAttrs">
382
409
</xs:complexType>
383
410
</xs:element>
384
411
```
@@ -390,13 +417,13 @@ Full Trace XSD
390
417
<xs:element name="goto_trace">
391
418
<xs:complexType>
392
419
<xs:choice minOccurs="0" maxOccurs="unbounded">
393
- <xs:element name ="assignment"></xs:element>
394
- <xs:element name ="failure"></xs:element>
395
- <xs:element name ="function_call"></xs:element>
396
- <xs:element name ="function_return"></xs:element>
397
- <xs:element name ="input"></xs:element>
398
- <xs:element name ="output"></xs:element>
399
- <xs:element name ="location-only"></xs:element>
420
+ <xs:element ref ="assignment"></xs:element>
421
+ <xs:element ref ="failure"></xs:element>
422
+ <xs:element ref ="function_call"></xs:element>
423
+ <xs:element ref ="function_return"></xs:element>
424
+ <xs:element ref ="input"></xs:element>
425
+ <xs:element ref ="output"></xs:element>
426
+ <xs:element ref ="location-only"></xs:element>
400
427
</xs:choice>
401
428
</xs:complexType>
402
429
</xs:element>
@@ -407,7 +434,7 @@ Notes
407
434
408
435
The path from the input C code to XML trace goes through the following
409
436
steps:\
410
- C -> GOTO -> SSA -> GOTO Trace -> XML Trace
437
+ ` C ` → ` GOTO ` → ` SSA ` → ` GOTO Trace ` → ` XML Trace `
411
438
412
439
#### SSA to GOTO Trace
413
440
0 commit comments