@@ -74,10 +74,12 @@ Every trace step optionally contains the source location as an element.
7474``` {.xml}
7575<xs:element name="location">
7676 <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"/>
7980 <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"/>
8183 </xs:complexType>
8284</xs:element>
8385```
@@ -88,14 +90,14 @@ Trace Steps in XML
8890The attributes ` hidden, thread, step_nr ` are common to all trace steps.
8991
9092``` {.xml}
91- <xs:attributeGroup name="traceStepAttrs"/ >
93+ <xs:attributeGroup name="traceStepAttrs">
9294 <xs:attribute name="hidden" type="xs:string"></xs:attribute>
9395 <xs:attribute name="step_nr" type="xs:int"></xs:attribute>
9496 <xs:attribute name="thread" type="xs:int"></xs:attribute>
9597</xs:attributeGroup>
9698```
9799
98- [ Assert] {} (element name: ` failure ` )
100+ Assert (element name: ` failure ` )
99101
100102** Attributes** :
101103
@@ -127,14 +129,14 @@ The attributes `hidden, thread, step_nr` are common to all trace steps.
127129 <xs:all>
128130 <xs:element name="location" minOccurs="0"></xs:element>
129131 </xs:all>
130- <xs:attributeGroup ref="traceStepAttrs"/ >
132+ <xs:attributeGroup ref="traceStepAttrs">
131133 <xs:attribute name="property" type="xs:string"></xs:attribute>
132134 <xs:attribute name="reason" type="xs:string"></xs:attribute>
133135 </xs:complexType>
134136</xs:element>
135137```
136138
137- [ Assignment, Declaration] {} (element name: ` assignment ` )
139+ Assignment, Declaration (element name: ` assignment ` )
138140
139141** Attributes** :\
140142if the lhs symbol is known
@@ -143,7 +145,7 @@ if the lhs symbol is known
143145
144146- ` identifier ` : string (symbol name)
145147
146- - ` base_name ` : string (e.g. “ counter” )
148+ - ` base_name ` : string (e.g. " counter" )
147149
148150- ` display_name ` : string (e.g. "main::1::counter")
149151
@@ -160,7 +162,7 @@ always present
160162** Elements** :\
161163if the lhs symbol is known
162164
163- - ` type ` : C type (e.g. “ signed int” )
165+ - ` type ` : C type (e.g. " signed int" )
164166
165167always present
166168
@@ -192,7 +194,7 @@ always present
192194 <xs:element name="full_lhs" type="xs:string"></xs:element>
193195 <xs:element name="full_lhs_value" type="xs:int"></xs:element>
194196 </xs:all>
195- <xs:attributeGroup ref="traceStepAttrs"/ >
197+ <xs:attributeGroup ref="traceStepAttrs">
196198 <xs:attribute name="assignment_type" type="xs:string"></xs:attribute>
197199 <xs:attribute name="base_name" type="xs:string"
198200 use="optional"></xs:attribute>
@@ -205,7 +207,7 @@ always present
205207</xs:element>
206208```
207209
208- [ Input] {} (element name: ` input ` )
210+ Input (element name: ` input ` )
209211
210212** Attributes** :
211213
@@ -244,28 +246,22 @@ for each IO argument
244246** XSD** :
245247
246248``` {.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-
256249<xs:element name="input">
257250 <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>
263259 <xs:attributeGroup ref="traceStepAttrs"/>
264260 </xs:complexType>
265261</xs:element>
266262```
267263
268- [ Output] {} (element name: ` output ` )
264+ Output (element name: ` output ` )
269265
270266** Attributes** :
271267
@@ -281,12 +277,33 @@ for each IO argument
281277
282278for each IO argument
283279
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
285286
286287- ` value_expression ` : the internal representation of the value
287288
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 ` )
290307
291308** Attributes** :
292309
@@ -309,6 +326,8 @@ for each IO argument
309326
310327 - ` location ` : source location of the called function
311328
329+ - ` function ` : The function that is being called/returned from.
330+
312331** Example** :
313332
314333``` {.xml}
@@ -327,10 +346,18 @@ for each IO argument
327346 <xs:complexType>
328347 <xs:all>
329348 <xs:element name="location" minOccurs="0"></xs:element>
330- <xs:element name="function">
331- <!-- See below -->
332- </xs:element>
349+ <xs:element ref="function"/>
333350 </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>
334361 <xs:attributeGroup ref="traceStepAttrs"/>
335362 </xs:complexType>
336363</xs:element>
@@ -346,7 +373,7 @@ for each IO argument
346373</xs:element>
347374```
348375
349- [ All Other Steps] {} (element name: ` location-only ` )
376+ All Other Steps (element name: ` location-only ` )
350377
351378Only included if the source location exists and differs from the
352379previous one.\
@@ -378,7 +405,7 @@ previous one.\
378405 <xs:all>
379406 <xs:element name="location" minOccurs="0"></xs:element>
380407 </xs:all>
381- <xs:attributeGroup ref="traceStepAttrs"/ >
408+ <xs:attributeGroup ref="traceStepAttrs">
382409 </xs:complexType>
383410</xs:element>
384411```
@@ -390,13 +417,13 @@ Full Trace XSD
390417<xs:element name="goto_trace">
391418 <xs:complexType>
392419 <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>
400427 </xs:choice>
401428 </xs:complexType>
402429</xs:element>
@@ -407,7 +434,7 @@ Notes
407434
408435The path from the input C code to XML trace goes through the following
409436steps:\
410- C -> GOTO -> SSA -> GOTO Trace -> XML Trace
437+ ` C ` → ` GOTO ` → ` SSA ` → ` GOTO Trace ` → ` XML Trace `
411438
412439#### SSA to GOTO Trace
413440
0 commit comments