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:
Enabling the debugger displays a
(debug) prompt, at which point various commands can be entered to control parsing and inspect Daffodil state.
Note that you can optionally provide a file to the
--debug option. Each line in the file will be provided to the debugger as if it was type by the user.
Below is the list of commands and their descriptions.
Create a breakpoint, causing the debugger to stop when the element with the <element_id> name is created.
|Clear the screen|
Continue parsing the input data until parsing is complete. All breakpoints are ignored.
Set a condition on a specified breakpoint. When a breakpoint is encountered, the debugger only pauses if the DFDL expression evaluates to true. If the result of the DFDL expressions is not a boolean value, it is treated as false.
condition 1 dfdl:occursIndex() eq 3
Continue parsing the input data until a breakpoint is encountered. At which point, pause parsing and display a debugger console to the user.
Remove a breakpoint or display. Valid values for <type> are "breakpoint" and "display".
delete breakpoint 1
delete display 1
Disable a breakpoint or display. Valid values for <type> are "breakpoint" and "display".
disable breakpoint 1
disable display 1
Execute a debugger command every time a debugger console is displayed to the user.
display info infoset
Enable a breakpoint or display. Valid values for <type> are "breakpoint" and "display".
enable breakpoint 1
enable display 1
Evaluate a DFDL expression. If the expression evaluates to a complex element, then the XML representation for the complex element is displayed. If the expression evaluates to a simple type, then the value of the simple type is display.
Display help. If a command is given, display help information specific to that command and its subcommands.
Display the history of commands. If an argument is given, write the history to the specified file rather then printing it to the screen.
Print internal information to the console. <item> can be specified multiple times to display multiple pieces of information.
The valid items are:
info data infoset
|Immediately abort all processing.|
Change a debugger setting. The valid settings are:
set dataLength -1
set wrapLength 50
set removeHidden true
Perform a single parse action, pause parsing, and display a debugger prompt.
Continue parsing the input data until a breakpoint is encountered, while running display commands after every parse step. When a breakpoint is encountered, pause parsing and display a debugger console to the user.