You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Shanedell (via GitHub)" <gi...@apache.org> on 2023/04/28 21:16:47 UTC

[GitHub] [daffodil-vscode] Shanedell opened a new issue, #599: 1.3.0-rc1 - Debugger not behaving correctly

Shanedell opened a new issue, #599:
URL: https://github.com/apache/daffodil-vscode/issues/599

   This issue comes from @mbeckerle in the [vote thread for 1.3.0-rc1](https://lists.apache.org/thread/r2grf2lm3ox6m33g8n6s2gf65wn2lcrq). The issue is described below:
   
   ```txt
   Debugging seems to have regressed substantially in the basic debugging
   functionality (breakpoints and stepping) since the prior release.
   
   Here's a narration of the debugging I am attempting:
   
   I am debugging PCAP. This uses the ethernetIP schema, which jar file must
   be put on the daffodil debug classpath.
   
   The git hash I have for PCAP is 1f7d5610e97ec6914fa00478116154e440a7dfc8
   The git has I have for EthernetIP
   is 3a0de0c4d452a8c1c5d8f77c8e1580991cbc27b0
   
   I have verified that `sbt test` works. The schema is all working.
   
   When I try to do simple breakpoint debugging with the VSCode extension, I
   get nowhere.
   
   I set a breakpoint in the ethernetIP.dfdl.xsd line 68 (The MACDest
   element).
   
   I start a Daffodil Debug session, and hit the continue.
   
   It does not stop at the breakpoint. It just parses the entire file.
   
   So, I start again. I put a breakpoint in pcap.dfdl.xsd line 168 (The
   Ethernet element).
   
   I hit continue. It stops at the breakpoint in the pcap.dfdl.xsd line 168.
   
   Then I step-over until I am in the ethernetIP.dfdl.xsd file. That works.
   
   Then I attempt to set a breakpoint at line 70, the Ethertype element which
   is a couple of elements down from the current location.
   
   Except no breakpoint it set. Rather, execution resumes with a bunch of
   output going to the debug console, but this output is then quickly erased
   somehow. I'm not able to capture it before the panel gets cleared.
   
   Execution terminates, a dialog pops up saying the infoset.xml was written
   out, but that file is empty. That dialog also spontaneously goes away, not
   waiting to be dismissed.
   
   From this I've concluded that the basics are not working sufficiently.
   
   ```
   
   This needs to be addressed in the next release candidate for 1.3.0.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org.apache.org

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


[GitHub] [daffodil-vscode] Shanedell commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1532304963

   @mbeckerle Sounds good, thank you. I will do my best to help out with your other issue


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] Shanedell commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1529876665

   @mbeckerle This seems to be a known issue #76 . Does the workaround above fix the issue for you? If so maybe we want to try to include the issue linked in this comment in 1.4.0?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] mbeckerle commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "mbeckerle (via GitHub)" <gi...@apache.org>.
mbeckerle commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1531964118

   Ah, so this mistake "${workstationFolder}" silently turns into empty string with no error/diagnostic other than complete failure. How useful :-(
   
   I revised my launch.json per your changes above. However, the JAR not being on the path means the schema cannot find the Daffodil plug-in required to run the ethernetIP component schema. That plug-in is part of the jar file for the schema, as compiled scala code (.class files), but in the source tree just exists as scala code. 
   
   By adding both the ethernetIP src/main/resources, src/test/resources, AND the jar file (last) to the daffodil debug classpath things started working better. 
   
   The debugger is now working roughly comparably to in the past for PCAP. 
   
   I will try a more complex schema next. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] Shanedell closed issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell closed issue #599: 1.3.0-rc1 - Debugger not behaving correctly
URL: https://github.com/apache/daffodil-vscode/issues/599


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] mbeckerle commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "mbeckerle (via GitHub)" <gi...@apache.org>.
mbeckerle commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1532101823

   I think it is ok to close this ticket. The problem of "debugger not behaving correctly" is resolved. 
   
   I am having no success with getting my more complex example working, but that's due to a separate issue that I'll open. 
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] Shanedell commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1529781820

   @mbeckerle Going to answer this here. The issue you are seeing is because your launch.json is not setup properly. You had attached this one:
   
   ```json
   {
       // Use IntelliSense to learn about possible attributes.
       // Hover to view descriptions of existing attributes.
       // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
       "version": "0.2.0",
       "configurations": [
           {
               "type": "dfdl",
               "request": "launch",
               "name": "pcap dns",
               "program": "${workstationFolder}/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd",
               "stopOnEntry": true,
               "data": "${workstationFolder}/src/test/resources/com/tresys/pcap/data/dns.cap",
               "infosetFormat": "xml",
               "infosetOutput": {
                   "type": "file",
                   "path": "/tmp/pcap-dns-infoset.xml"
               },
               "tdmlConfig": {
                   "action": "none",
                   "name": "${command:AskForTDMLName}",
                   "description": "${command:AskForTDMLDescription}",
                   "path": "${command:AskForTDMLPath}"
               },
               "debugServer": 4711,
               "openHexView": false,
               "openInfosetView": false,
               "openInfosetDiffView": false,
               "daffodilDebugClasspath": "${workstationFolder}/lib_managed/jars/com.owlcyberdefense/dfdl-ethernetip/dfdl-ethernetip-1.2.0.jar",
               "variables": {},
               "tunables": {},
               "dataEditor.omegaEditPort": 9001,
               "dataEditor.logFile": "${workspaceFolder}/dataEditor-${omegaEditPort}.log",
               "dataEditor.logLevel": "info"
           }
       ]
   }
   ```
   
   You mentioned having to set that `tdmlConfig` to get anywhere, but you actually don't have to. The issue you are running into is because you are defining `${workstationFolder}` which is not a variable, you want `${workspaceFolder}` instead.
   
   But when I tried updating that locally it seemed that the `daffodilDebugClasspath` specified caused mine to stay at breakpoint on line 168 of `pcap.dfdl.xsd`. The reason being seems that trying to set breakpoint inside of the JAR file for dfdl-ethernet causes them not to be hit and if you set them during a debug it just finishes running like you mentioned.
   
   But if you have dfdl-ethernet in a directory behind dfdl-pcap try this `.vscode/launch.json`:
   
   ```json
   {
       // Use IntelliSense to learn about possible attributes.
       // Hover to view descriptions of existing attributes.
       // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
       "version": "0.2.0",
       "configurations": [
           {
               "type": "dfdl",
               "request": "launch",
               "name": "pcap dns",
               "program": "${workspaceFolder}/src/main/resources/com/tresys/pcap/xsd/pcap.dfdl.xsd",
               "stopOnEntry": true,
               "data": "${workspaceFolder}/src/test/resources/com/tresys/pcap/data/dns.cap",
               "infosetFormat": "xml",
               "infosetOutput": {
                   "type": "file",
                   "path": "/tmp/pcap-dns-infoset.xml"
               },
               "debugServer": 4711,
               "openHexView": false,
               "openInfosetView": false,
               "openInfosetDiffView": false,
               "daffodilDebugClasspath": "${workspaceFolder}/../dfdl-ethernet/src/main/resources:${workspaceFolder}/../dfdl-ethernet/target/classes",
               "variables": {},
               "tunables": {},
               "dataEditor.omegaEditPort": 9001,
               "dataEditor.logFile": "${workspaceFolder}/dataEditor-${omegaEditPort}.log",
               "dataEditor.logLevel": "info"
           }
       ]
   }
   ```
   
   set the breakpoint on line 168 of `pcap.dfdl.xsd`. Once that breakpoint is hit, step into and set the breakpoints in ethernetIP.dfdl.xsd on 68 and 70, all breakpoints should now work.
   
   Can you ensure this way works so we can narrow down the error to setting break points inside of a JAR file?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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


[GitHub] [daffodil-vscode] Shanedell commented on issue #599: 1.3.0-rc1 - Debugger not behaving correctly

Posted by "Shanedell (via GitHub)" <gi...@apache.org>.
Shanedell commented on issue #599:
URL: https://github.com/apache/daffodil-vscode/issues/599#issuecomment-1531973035

   @mbeckerle Instead of using the JAR can you point it to the compiled classes, doing something like:
   
   ```txt
   ${workspaceFolder}/../dfdl-ethernet/target/classes
   ```
   
   does that also work?
   
   If this work around works for now, how do you feel on possibly having this issue closed? Then making #76 be a part of release 1.4.0 which should allow you to enable breakpoints inside of a schema, thats inside of a JAR? 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

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