...
Code Block |
---|
|
./daffodil --debug [file] 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.
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.
Commands
Command | Short Command | Arguments | Description | Example |
---|
break | b | <element_id> | Create a breakpoint, causing the debugger to stop when the element with the <element_id> name is created. | break element.foo |
clear | c | | Clear the screen | clear |
complete | comp | | Continue parsing the input data until parsing is complete. All breakpoints are ignored. | complete |
condition | cond | <breakpoint_id> <dfdl_expression> | 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() = 3 |
continue | c | | Continue parsing the input data until a breakpoint is encountered. At which point, pause parsing and display a debugger console to the user. | continue |
delete | d | <type> <id> | Remove a breakpoint or display. Valid values for <type> are "breakpoint" and "display". | delete breakpoint 1 delete display 1 |
disable | disdis | <type> <id> | Disable a breakpoint or display. Valid values for <type> are "breakpoint" and "display". | disable breakpoint 1 disable display 1 |
display | didi | <debugger command> | Execute a debugger command every time a debugger console is displayed to the user. | display info infoset |
enable | ee | <type> <id> | Enable a breakpoint or display. Valid values for <type> are "breakpoint" and "display". | enable breakpoint 1 enable display 1 |
eval | evev | [type] <dfdl_expression> | Evaluate a DFDL expression. The [type] argument determines how to display the result of the dfdl_expression. The value of [type] may be "string", "number", "boolean", or "node". If [type] is not given, then "node" is assumed." | eval number dfdl:occursIndex() |
help | hh | [<command>command] | Display help. If a command is given, display help information specific to that command and its subcommands. | help help info |
history | hi | [outfile] | Display the history of commands. If an argument is given, write the history to the specified file rather then printing it to the screen. | history
history out.txt
|
info | i | <item>... | Print various pieces of internal information to the console. <item> can be specified multiple times to display multiple pieces of information. The valid items are: Item | Short Item | Description | item | description |
---|
arrayIndex | ai
| current index of the element in an arraydisplay the current array limit | bitLimit | bl | display the current bit limit | bitPosition | bp | display the current bit position in the data | breakpoints | b | display the list of breakpoints | childIndex | ci | display the current child index | data | d | display the input data | diff | diff | display the differences from the previous state | discriminator | dis | display whether or not a discriminator is set | displays | list of displays | di | display the current 'display' expressions | groupIndex | gi | display the current group index | infoset | i | display the | infoset | current infoset | occursCount | oc | display the current occurs count | parser | p | display the current Daffodil parser | path | path | display in the schema , using schema component designator |
| info data infoset |
quit | q | | Immediately abort all processing. | quit |
set | set | <setting> <value> | Change a debugger setting. The valid settings are: Setting | Value Type | Description | Default |
---|
breakOnFailure | boolean | Set whether or the debugger should break on failures. If set to false the normal processing occurs. If set to true, any errors cause a break. Note that due to the backtracking behavior, not all failures are fatal. | false | breakOnlyOnCreation | boolean | Set whether or not breakpoints should only be evaluated on element creation. <value> must be either true/false or 1/0. If true, breakpoints only stop on element creation. If false, breakpoints stop anytime a parser interacts with an element. | true | dataLength | integer | Set the number of bytes to display when displaying input data. If negative, display all input data. This only affects the 'info data' command. | 70 | infosetLines | integer | Set the maximum number of lines of the infoset to display. This displays the last X number of lines. If negative, display the entire infosetto display when displaying the infoset. This only affects the 'info infoset' command. This shows the last <value> lines of the infoset. If <value> is less than or equal to zero, the entire infoset is printed. | -1 | removeHidden | boolean | Set whether or not to remove hidden elements ( via e.g through the use of dfdl:hiddenGroupRef) when displaying the infosetshould be displayed. This effects the 'eval' and 'info infoset' commands. <value> must be either true/false or 1/0. | false | wrapLength | integer | Set the number of character characters at which to wrap data or infoset when printed to the consolepoint output wraps. This only affects the 'info data' and 'info infoset' commands. A length less than or equal to zero disables wrapping. | 80 |
| set dataLength -1 set wrapLength 50 set removeHidden true |
step | s | | Perform a single parse action, pause parsing, and display a debugger console to the userprompt. | step |
trace | tundisplay | | <display_id> | Remove a display created using the "display" command | 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. | trace undisplay 1 |