You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/01/13 14:52:09 UTC

[GitHub] [incubator-daffodil] stevedlawrence opened a new pull request #470: Add support for displaying variables in the debugger

stevedlawrence opened a new pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470


   Adds a new info subcommand called "variables" to show the current
   in-scope state and value of variables. For example:
   
       (debug) info variables
         variables:
           ex:var1:  (undefined)
           {http://www.ogf.org/dfdl/dfdl-1.0/}binaryFloatRep: ieee (default)
           {http://www.ogf.org/dfdl/dfdl-1.0/}byteOrder: bigEndian (default)
           {http://www.ogf.org/dfdl/dfdl-1.0/}encoding: UTF-8 (default)
           {http://www.ogf.org/dfdl/dfdl-1.0/}outputNewLine: %LF; (default)
   
   Also allows specifcying one or more variable names to only output those
   if you don't want to see all variables, for example:
   
       (debug) info varibles var1 byteOrder
         variables:
           ex:var1:  (undefined)
           {http://www.ogf.org/dfdl/dfdl-1.0/}byteOrder: bigEndian (default)
   
   This also modifies the info command so that you can provide parameters
   to subcommands, which is needed to allow variable names after the "info
   variables".
   
   Fixes the "info data" command which at one point
   had optional parameters to control how data should be output (either
   text or binary). This was broken at some point, but is now available.
   
   Allows the "clear" command to be used in the "display" command, e.g.
   
     (debug) display clear
   
   This can be useful to clear the screen every time the debugger pauses,
   sometimes making it easier to see what changed.
   
   DAFFODIL-2453


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-daffodil] stevedlawrence commented on pull request #470: Add support for displaying variables in the debugger

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470#issuecomment-759643550


   The diff approach was actually not as complicated as I thought it might be. I've added it to this commit. Let me know if that seems like a reasonable approach to have variables show up during trace mode, which does include the info diff command.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-daffodil] stevedlawrence commented on pull request #470: Add support for displaying variables in the debugger

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470#issuecomment-759555230


   > Does Trace dump the variables every time? Or no change to trace behavior?
   
   Currently no change in trace behavior. We could make it so trace dumps all variables every step, but that feels abit too verbose to me (but maybe that's expected with trace?). Another option might be to modify the "diff" command to support printing variable changes. That's could probably be useful, but it's maybe a bit of an effort--so maybe it makes sense to be part of a separate PR?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-daffodil] stevedlawrence commented on pull request #470: Add support for displaying variables in the debugger

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470#issuecomment-759555484


   > Coverage report looks good, although a CLI "info data text/binary" test would make almost all of the newly added code covered by tests.
   
   Agreed, will add.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull request #470: Add support for displaying variables in the debugger

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on a change in pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470#discussion_r556772661



##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/debugger/InteractiveDebugger.scala
##########
@@ -1404,6 +1469,24 @@ class InteractiveDebugger(runner: InteractiveDebuggerRunner, eCompilers: Express
               if (prestate.arrayPos != state.arrayPos) { debugPrintln("occursIndex: %d -> %d".format(prestate.arrayPos, state.arrayPos), "  "); diff = true }
               if (prestate.groupPos != state.groupPos) { debugPrintln("groupIndex: %d -> %d".format(prestate.groupPos, state.groupPos), "  "); diff = true }
               if (prestate.childPos != state.childPos) { debugPrintln("childIndex: %d -> %d".format(prestate.childPos, state.childPos), "  "); diff = true }
+              prestate.variableMap.qnames.foreach { qname =>

Review comment:
       Yeah, this is good. diff shows variables that changed. Great. 
   +1




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-daffodil] stevedlawrence merged pull request #470: Add support for displaying variables in the debugger

Posted by GitBox <gi...@apache.org>.
stevedlawrence merged pull request #470:
URL: https://github.com/apache/incubator-daffodil/pull/470


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org