The Daffodil Command Line Interface (CLI) comes with a built-in interactive debugger that pauses parsing and allows for user inspection of the parsing state. To start Daffodil in debugger mode, provide the global --debug/-d option, for example:
Code Block | ||
---|---|---|
| ||
./daffodil --debug parse --schema schema.dfdl.xsd input.dat |
Enabling the debugger displays a (debug)
prompt, at which point various commands can be entered to control parsing and inspect Daffodil state. Below is the list of commands and their descriptions.
Commands
...
break
...
<element_id>
...
break element.foo
...
clear
...
clear
...
condition
...
<breakpoint_id> <dfdl_expression>
...
condition 1 dfdl:occursIndex() = 3
...
continue
...
continue
...
delete
...
<breakpoint_id>
...
delete 1
...
disable
...
<type> <id>
...
disable breakpoint 1
disable display 1
...
display
...
<debugger command>
...
display info infoset
...
enable
...
<type> <id>
...
enable breakpoint 1
enable display 1
...
eval
...
[type] <dfdl_expression>
...
eval number dfdl:occursIndex()
...
help
...
[<command>]
...
help
help info
...
info
...
<item>...
...
Print various pieces of internal information to the console. The valid items are:
item | description |
---|---|
arrayIndex | current index of the element in an array |
bitLimit | current bit limit |
bitPosition | current bit position in the data |
breakpoints | list of breakpoints |
childIndex | current child index |
data | input data |
discriminator | whether or not a discriminator is set |
displays | list of displays |
infoset | current infoset |
occursCount | occurs count |
path | path in the schema, using schema component designator |
...
info data infoset
...
quit
...
quit
...
set
...
<setting> <value>
...
Change a debugger setting. The settings are:
Setting | Type | Description |
---|---|---|
dataLength | integer | number of bytes to display when displaying input data. If negative, display all input data. |
infosetLines | integer | number of lines of the infoset to display. This displays the last X number of lines. If negative, display the entire infoset |
removeHidden | boolean | whether or not to remove hidden elements (via dfdl:hiddenGroupRef) when displaying the infoset |
wrapLength | integer | number of character at which to wrap data or infoset when printed to the console |
...
set dataLength -1
set wrapLength 50
set removeHidden true
...
step
...
step
...
undisplay
...
<display_id>
...