Skip to content

Commit 20f964f

Browse files
author
Thomas Kiley
committed
Update trace docs and spec for the loop-head element
Extend the documentation to cover the new version of location-only called loop-head.
1 parent 4ee5f2d commit 20f964f

File tree

3 files changed

+56
-5
lines changed

3 files changed

+56
-5
lines changed

doc/assets/xml_spec.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,18 @@ Function Return (element name: `function_return`)
389389
</xs:element>
390390
```
391391

392-
All Other Steps (element name: `location-only`)
392+
All Other Steps (element name: `location-only` and `loop-head`)
393+
394+
A step that indicates where in the source program we are.
395+
396+
A `location-only` step is emitted if the source location exists and
397+
differs from the previous one.
398+
399+
A `loop-head` step is emitted if the location relates to the start of a loop,
400+
even if the previous step is also the same start of the loop (to ensure
401+
that it is printed out for each loop iteration)
402+
393403

394-
Only included if the source location exists and differs from the
395-
previous one.\
396404
**Attributes**:
397405

398406
- `hidden`: boolean attribute
@@ -411,6 +419,9 @@ previous one.\
411419
<location-only hidden="false" step_nr="19" thread="0">
412420
<location .. />
413421
</location-only>
422+
<loop-head hidden="false" step_nr="19" thread="0">
423+
<location .. />
424+
</loop-head>
414425
```
415426

416427
**XSD**:
@@ -424,6 +435,15 @@ previous one.\
424435
<xs:attributeGroup ref="traceStepAttrs">
425436
</xs:complexType>
426437
</xs:element>
438+
439+
<xs:element name="loop-head">
440+
<xs:complexType>
441+
<xs:all>
442+
<xs:element name="location" minOccurs="0"></xs:element>
443+
</xs:all>
444+
<xs:attributeGroup ref="traceStepAttrs">
445+
</xs:complexType>
446+
</xs:element>
427447
```
428448

429449
Full Trace XSD
@@ -440,6 +460,7 @@ Full Trace XSD
440460
<xs:element ref="input"></xs:element>
441461
<xs:element ref="output"></xs:element>
442462
<xs:element ref="location-only"></xs:element>
463+
<xs:element ref="loop-head"></xs:element>
443464
</xs:choice>
444465
</xs:complexType>
445466
</xs:element>

doc/assets/xml_spec.tex

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,18 @@ \subsection{Trace Steps in XML}
373373
374374
375375
\begin{center}
376-
{\Large All Other Steps} (element name: \texttt{location-only})
376+
{\Large All Other Steps} (element name: \texttt{location-only} and
377+
\texttt{loop-head})
377378
\end{center}
378379
379-
\noindent Only included if the source location exists and differs from the previous one.\\
380+
\noindent A step that indicates where in the source program we are.
381+
382+
A \texttt{location-only} step is emitted if the source location exists and
383+
differs from the previous one.
384+
385+
A \texttt{loop-head} step is emitted if the location relates to the start of a loop,
386+
even if the previous step is also the same start of the loop (to ensure
387+
that it is printed out for each loop iteration) \\
380388
381389
\noindent\textbf{Attributes}:
382390
\begin{itemize}
@@ -395,6 +403,9 @@ \subsection{Trace Steps in XML}
395403
<location-only hidden="false" step_nr="19" thread="0">
396404
<location .. />
397405
</location-only>
406+
<loop-head hidden="false" step_nr="19" thread="0">
407+
<location .. />
408+
</loop-head>
398409
\end{minted}
399410
400411
\noindent\textbf{XSD}:
@@ -407,6 +418,14 @@ \subsection{Trace Steps in XML}
407418
<xs:attributeGroup ref="traceStepAttrs">
408419
</xs:complexType>
409420
</xs:element>
421+
<xs:element name="loop-head">
422+
<xs:complexType>
423+
<xs:all>
424+
<xs:element name="location" minOccurs="0"></xs:element>
425+
</xs:all>
426+
<xs:attributeGroup ref="traceStepAttrs">
427+
</xs:complexType>
428+
</xs:element>
410429
\end{minted}
411430
412431
\subsection{Full Trace XSD}
@@ -422,6 +441,7 @@ \subsection{Full Trace XSD}
422441
<xs:element ref="input"></xs:element>
423442
<xs:element ref="output"></xs:element>
424443
<xs:element ref="location-only"></xs:element>
444+
<xs:element ref="loop-head"></xs:element>
425445
</xs:choice>
426446
</xs:complexType>
427447
</xs:element>

doc/assets/xml_spec.xsd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@
138138
</xs:complexType>
139139
</xs:element>
140140

141+
<xs:element name="loop-head">
142+
<xs:complexType>
143+
<xs:all>
144+
<xs:element ref="location" minOccurs="0"/>
145+
</xs:all>
146+
<xs:attributeGroup ref="traceStepAttrs"/>
147+
</xs:complexType>
148+
</xs:element>
149+
141150
<xs:element name="goto_trace">
142151
<xs:complexType>
143152
<xs:choice minOccurs="0" maxOccurs="unbounded">
@@ -148,6 +157,7 @@
148157
<xs:element ref="input"></xs:element>
149158
<xs:element ref="output"></xs:element>
150159
<xs:element ref="location-only"></xs:element>
160+
<xs:element ref="loop-head"></xs:element>
151161
</xs:choice>
152162
</xs:complexType>
153163
</xs:element>

0 commit comments

Comments
 (0)