You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by ji...@gmail.com, ji...@gmail.com on 2018/07/05 15:54:21 UTC

Developing a dfdl schema - Debugging byteposition

Is there a way to find out where each element is in file when parsing? Without lots of other debugging data?

Re: Developing a dfdl schema - Debugging byteposition

Posted by Jim Welch <ji...@gmail.com>.
Thanks! Better than a full trace. I am used to debugging with position as
bytes and as a parameter to the XML name.
<App_Type Position=123>456</App_Type>

Re: Developing a dfdl schema - Debugging byteposition

Posted by Steve Lawrence <sl...@apache.org>.
Probably the best way to do this right now is to use the CLI interactive
debugger [1]. To start it, use the --debug flag, e.g.:

  daffodil --debug parse --schema schema.dfdl.xsd input.dat

The debugger works similar to gdb if you're familiar with that. I like
to use the following when I develop schemas and want to step through the
parse to figure out how the parse is going or where things are going off
the rails:

  (debug) display info data infoset bitPosition
  (debug) step

Continually pressing <enter> will step through the parse and output a
dump of the data, the current infoset and the current bit position.
Running 'help info' will show other commands you can add to the display
command to show information at each step.

Alternatively, you can use --trace instead of --debug and that will just
run the entire parse and output lots of information.

- Steve

[1] https://daffodil.apache.org/debugger/

On 07/05/2018 11:54 AM, jimwelchok@gmail.com wrote:
> Is there a way to find out where each element is in file when parsing? Without lots of other debugging data?
>