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 2022/03/03 18:41:55 UTC

[GitHub] [daffodil-vscode] Shanedell opened a new issue #66: Multi-file Breakpoint

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


   Need to enable breakpoints in imported files/schemas.
   
   A good schema for testing this will be `PCAP` as it imports a schema from the same directory as well as the schemas for `ethernetIP`.
   
   For this item to be completed you should be able to set a breakpoint in every `.xsd` file being imported by a schema and the breakpoints are hit during debug.
   
   - Example if you put breakpoint in every `.xsd` file in the `PCAP` and `ethernetIP` schema repos. When you debug the breakpoints in every file should be hit
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1059573641


   I wasn't sure, but I think I observed this "breaks on the main schema" even though the breakpoint is inside it, as well, but I wasn't certain.
   
   So that behavior is interesting, but not useful. 
   
   The breakpoint on the inner element, inside of the GIR thing, is because I was stepping along watching it create objects for all the various branches of the choice, then backtrack them, and it seemed that element defined at line 292 would be the next thing it should attempt to parse, so I was hoping it would breakpoint there. 
   
   It is very desirable to have a breakpoint stop the debug at the "attempt" to parse an element, even if it subsequently fails and backtracks the element. Often you have to watch it fail, put more breakpoints inside to see what is going on, etc. 
   
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058374851


   @mbeckerle I believe if you look at the discussion of the PR, https://github.com/apache/daffodil-vscode/pull/77, @arosien states he could not find any schemas with breakpoint-able lines as most of the items were type definitions. So, @arosien can correct if me if I am wrong, but I think that is what you are seeing.
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1062947776


   I also agree with @arosien that this fix, without Jar support, is sufficient for a 1.0.0-rc2. 
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1017642642


   Yes. #54 was dealing with making sure that when a schema tried importing other schemas. This was done with the new launch config variable `daffodilDebugClasspath` that will add the necessary jar files/schema files to the classpath so they can be imported.
   
   However, even though we can now get other schemas imported whenever a break point is set in an imported schema it does not get hit by the debugger. Based on output from the debugger it does seem to be setting the break point but just doesn't seem to stop at it.
   


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1062412931


   Ok, I found the problem, and like #77 the code was incorrectly using the main schema file instead of using the schema file of the current location relayed by Daffodil:
   
   https://github.com/apache/daffodil-vscode/blob/ee71cf1cc9e2a7fce1abac2b46700c352cb5e404/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala#L367
   
   I'll push a patch for using the correct path, but this won't work for jar-based schema files. That work is captured by #76.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1063311352


   Oh look, I left myself a TODO with notes about a data race!
   
   https://github.com/apache/daffodil-vscode/blob/main/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala#L757


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1017734265


   I've noticed a related problem: the external schemas are correctly loaded into the debugger via the `daffodilDebugClasspath` parameter, but the extension itself doesn't know how to resolve references to schemas inside these archives. The outer schema refers to say,
   ```
   <xs:import
       namespace="urn:ethernet"
       schemaLocation="com/owlcyberdefense/dfdl/xsd/ethernetIP.dfdl.xsd"/>
   ```
   which is inside the referenced jar, but the VS Code extension doesn't know how to resolve that when Cmd-clicking it. As a result I'm not sure how a breakpoint on a referenced schema could even be set.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1024425839


   > You actually don't need to have the jar in the class path if you have something like this it should also work
   >
   > "daffodilDebugClasspath": "/FULL/PATH/TO/dfdl-ethernet/src/main/resources:/FULL/PATH/TO/dfdl-pcap/src/main/resources"
   
   PSA: This works for schemas that only have files under `src/main/resources`, but as I discovered, the ethernet project specifically has some Scala files that are required for the schemas to work, so the ethernet project must be referenced as a packaged 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] stevedlawrence commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1062474376


   1.0.0 was never released. I suggest we just cancel the 1.0.0-rc1 vote, fix this bug, and then start a 1.0.0-rc2 vote.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1063717876


   Aha! The reason the reported stack doesn't match the hit breakpoint is that after the stack is updated from the `startElement` call, Daffodil invokes the `endElement` callback which then pops the stack. This happens before VS Code requests the current stack, so the reported stack has already been popped.
   
   Our `endElement` callback should block if we've stopped at a breakpoint.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1025018144


   As [mentioned above](https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1021441014), the path to the location was incorrectly set to be the starting schema file, not the actual location the debugger is currently processing. I have a fix for that and will push a PR. 
   
   A related issue is that one way a user could navigate to an imported schema would be via the `StepIn` command, where the definition of the current entity was declared elsewhere. However `StepIn` is currently not implemented; see #5.
   
   However, these fixes won't apply for schemas that are not directly available in the filesystem, i.e., schemas in included jar files. To handle that scenario I have an additional patch that changes the internal representation of a schema location from a (file) path to a URI, as schemas within an included jar file have URIs that begin `jar:file:`. However, to actually display the schema within the editor, since the content is within some jar file, we need to send [`LoadedSource`](https://microsoft.github.io/debug-adapter-protocol/specification#Events_LoadedSource)` DAP events from our backend to VS Code when we notice any referenced schema outside of the initial schema. We can do this eagerly (scan the XML, etc.) or lazily (as the schema is processed we notify when a new schema is encountered. The editor then will request the source content, and the backend can send it (since we can access the data of the jar file on the classpath), and the editor will display the (read-only) conten
 t. Implementation-wise, we need to re-enable the `supportsLoadedSourcesRequest` initialization parameter that was disabled in #25, decide the schema source discovery strategy, and handle the appropriate events and requests.
   
   For [1.0.0](https://github.com/apache/daffodil-vscode/milestone/1) we need to decide whether navigation into classpath-hosted jar files is necessary, or not. (Files on the normal file system should have working breakpoints once the small fix is pushed.)


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1021441014


   I found the source of the problem: the debugger code incorrectly assumes locations are within the initial schema file, not the actual file the debugger is processing. See https://github.com/apache/daffodil-vscode/blob/main/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala#L788. Instead we need to reference the current file via the `SchemaFileLocation.uriString` to compare it against the paths/URIs in the breakpoint list.


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058517834


   So I am not getting breakpoints on those imported schemas either, but I am wondering if it because it is for the same reason as @arosien mentioned in his PR? Are those two schema imported from `EDIFACT-Common` just type definitions if so I that is why no breakpoints don't happen because I know you can put a breakpoint on importing a schema but those aren't hit.
   
   @mbeckerle If you expect breakpoints in this schema specifically can you say a couple lines you would think would be valid breakpoints?
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058457103


   Ah. Checkout branch "daffodil-dev"
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058379120


   EDIFACT at https://github.com/DFDLSchemas/EDIFACT


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1062414434


   Since this issue is blocking the 1.0.0 milestone, I recommend the immediate fix for non-jar-based schemas and fast-follow with a 1.0.1 release that fixes #76.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1024446435


   > Can you test adding `/FULL/PATH/TO/dfdl-ethernet/src/main/scala` to `daffodilDebugClasspath` to see if includes it? Just to be sure
   
   I'm fairly sure that won't work, as that path contains `.scala` source files, not compiled `.class` files. One could point to the correct `target` path under the project directory, but it's probably simpler to build the jar that contains everything and point to that.


-- 
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] stevedlawrence commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
stevedlawrence commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1062481493


   Oops, i misread, Agreed that #76 can probably wait for a following release.


-- 
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] arosien edited a comment on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien edited a comment on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1063311352


   Oh look, myself-in-the-past left me a TODO with notes about a data race!
   
   https://github.com/apache/daffodil-vscode/blob/ee71cf1cc9e2a7fce1abac2b46700c352cb5e404/server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala#L757


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1059447999


   I wasn't able to trigger a breakpoint at EDIFACT-SupplyChain-Segments-D.03B.xsd line 292 (under complexType`GIR-RelatedIdentificationNumbers`), but looking at the expected infoset for INVOIC_D.03B_Interchange_with_UNA.txt I don't see any `GIR` output.
   
   If instead I put a breakpoint at complex type `NAD-NameAndAddress` (EDIFACT-SupplyChain-Segments-D.03B.xsd:378; note this is the complexType tag, _not_ an element tag), then a breakpoint **is** triggered:
   
   <img width="1402" alt="_Extension_Development_Host__-_EDIFACT-SupplyChain-Messages-D_03B_xsd_—_sampleWorkspace_and_logging_scala_—_daffodil-vscode" src="https://user-images.githubusercontent.com/31163/156827564-49132349-7014-4c1a-af59-628a49e30478.png">
   
   Note that the _encountered breakpoint_ is at the point where the "outer" schema (-Messages*) references the "inner" schema (-Segments) where the breakpoint is _defined_. Yes, this is somewhat weird, but the debugger is just relying on the location information from the Daffodil layers.
   
   So it seems we can break on external type definitions (only) when they match, and the referenced breakpoint location is at the use site, not the declaration site.
   
   Any thoughts?


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1025923419


   I could live with having to make the source directories for all schemas available for version 1.0.0. This would be sufficient for using the debugger in training on DFDL. 
   
   What happens if I try to step into a schema in a jar? Does it just not happen, or will I get some notification that it is in a jar so cannot be stepped into, so you must step over?
   
   Jars are the natural way schemas are packaged and obtained in Daffodil however, so this feature to be able to step into schemas where the source is in a jar is something we will want fairly soon. E.g., schemas being devloped now include 3 or 4 other schemas by way of jars on the classpath, so debugging there needs to support jars as first class. 


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058541547


   The data file I chose was src/test/resources/EDIFACT-SupplyChain-D03B/TestData/INVOIC_D.03B_Interchange_with_UNA.txt
   
   Set breakpoint in src/main/resources/EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Segments-D.03B.xsd line 292.
   
   It should stop there for this data. 
   
   I tried to give all the details allowing you to reproduce earlier in this thread. 


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058829725


   I'll check it out.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1065496183


   > Our endElement callback should block if we've stopped at a breakpoint.
   
   I filed #90 for this problem.


-- 
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] tuxji closed issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
tuxji closed issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66


   


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1017644203


   > However, even though we can now get other schemas imported whenever a break point is set in an imported schema it does not get hit by the debugger. Based on output from the debugger it does seem to be setting the break point but just doesn't seem to stop at it.
   
   Cool, thanks, that's what I thought. I suspect the path-matching of the breakpoint handling isn't attuned to whatever representation is used for classpath files, which sounds obvious but I'm writing it anyway.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1017620313


   Is this the follow-on issue from #54 where breakpoints from schemas loaded via classpath aren't working?


-- 
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] arosien edited a comment on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien edited a comment on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1025018144


   As [mentioned above](https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1021441014), the path to the location was incorrectly set to be the starting schema file, not the actual location the debugger is currently processing. I have a fix for that and will push a PR. 
   
   A related issue is that one way a user could navigate to an imported schema would be via the `StepIn` command, where the definition of the current entity was declared elsewhere. However `StepIn` is currently not implemented; see #5.
   
   However, these fixes won't apply for schemas that are not directly available in the filesystem, i.e., schemas in included jar files. To handle that scenario I have an additional patch that changes the internal representation of a schema location from a (file) path to a URI, as schemas within an included jar file have URIs that begin `jar:file:`. However, to actually display the schema within the editor, since the content is within some jar file, we need to send [`LoadedSource`](https://microsoft.github.io/debug-adapter-protocol/specification#Events_LoadedSource) DAP events from our backend to VS Code when we notice any referenced schema outside of the initial schema. We can do this eagerly (scan the XML, etc.) or lazily (as the schema is processed we notify when a new schema is encountered. The editor then will request the source content, and the backend can send it (since we can access the data of the jar file on the classpath), and the editor will display the (read-only) content
 . Implementation-wise, we need to re-enable the `supportsLoadedSourcesRequest` initialization parameter that was disabled in #25, decide the schema source discovery strategy, and handle the appropriate events and requests.
   
   For [1.0.0](https://github.com/apache/daffodil-vscode/milestone/1) we need to decide whether navigation into classpath-hosted jar files is necessary, or not. (Files on the normal file system should have working breakpoints once the small fix is pushed.)


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1028133293


   > What happens if I try to step into a schema in a jar? Does it just not happen, or will I get some notification that it is in a jar so cannot be stepped into, so you must step over?
   
   Currently step-in isn't supported (#5), so that isn't an issue, although there isn't any message to the user that the operation isn't supported, which is kind of what you want. I'll add a note to the issue that there at least should be a warning that step-in isn't available.


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058563176


   Yeah the breakport doesn't get hit for me either I am not sure if does with the include statements. @arosien Would you be able to try debugging EDIFACT schema using the notes from @mbeckerle and report what you find?


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1063303646


   I have evidence that the reported-vs-actual stack mismatch mentioned above (https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1059447999) is true:
   
   ```
   breakpoint hit: Location(file:[/Users/arosien/nteligen/EDIFACT/src/main/resources/EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Segments-D.03B.xsd](),Line(380))
   ```
   
   The shown breakpoint is in the external file, and we send a Stopped(reason=breakpoint) event via DAP, which then causes VS Code to request the current stack, but the current stack doesn't include the breakpoint location. There must be a data race, or something, within our backend.


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1020292388


   I'm ok with a slighly inconvenient "feature" that requires an extra setup step so that schemas become available to the debugger. 
   
   For example in IntelliJ and Eclipse, if you want to be able to step into source code of a java/scala library, there has to be source-jar info associated with the jar. 
   
   For eclipse, this requires the extra 'sbt eclipse' step, which explicitly creates a classpath XML file which tells eclipse where these source-jars are and what the classpath is. Not sure how intelliJ discovers these jars, but it doesn't require an explicit step. It must be just searching for them wherever it finds the regular library, and using if found. 
   
   I can even put breakpoints in the libraries based on java/scala source code. But I can't edit them. 
   
   So my suggestion is maybe investigate how VSCode for Java works with Java source code for external libraries. How we do it has to work alike (or so it seems to me). 
   
   Daffodil class path usage is really really similar in intention to how Java classpaths work. In fact some DFDL schema jars will include class files for User-defined functions and layering extensions and validators used by the schema, so Daffodil's jars really ARE java jars that are depending on java standard classpath behavior. 


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1024430911


   Can you test adding `/FULL/PATH/TO/dfdl-ethernet/src/main/scala` to `daffodilDebugClasspath` to see if includes it? Just to be sure


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058574497


   @arosien Important: you want the "daffodil-dev" branch of the EDIFACT repo.


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1018658277


   > You actually don't need to have the jar in the class path if you have something like this it should also work
   >
   > `"daffodilDebugClasspath": "/FULL/PATH/TO/dfdl-ethernet/src/main/resources:/FULL/PATH/TO/dfdl-pcap/src/main/resources"`
   
   Ah, that's cool, one can have both a directory with files and a jar file in that classpath 👍 . However, this only makes it possible for the Daffodil running in the debugger process to load the imported schema, not for VS Code to "follow links" from the main schema to the imported schema, like via Cmd-click. We'd have to teach VS Code how to navigate those references explicitly, since a reference like `/com/blah/foo.schema` might actually be on some directory path `/somewhere/else/com/blah/foo.schema`.
   
   It may be possible to use the DAP protocol's [`LoadedSource`](https://microsoft.github.io/debug-adapter-protocol/specification#Events_LoadedSource) functionality to have the Daffodil debugger be the source of truth (content) for imported schema that aren't necessarily directly available as files (and may be in jar files, etc.), but this still doesn't solve the VS Code navigation 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 closed issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell closed issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66


   


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1060921650


   > I wasn't sure, but I think I observed this "breaks on the main schema" even though the breakpoint is inside it, as well, but I wasn't certain.
   >
   > So that behavior is interesting, but not useful.
   
   Agreed. My only explanation for what I see is that the Daffodil end is actually breaking at the external file location, but the stack relayed to VS Code either isn't correct or VS Code can't locate the external file in the stack and therefore gives a best effort by only showing the stack at the deepest point of the main schema.
   
   I'll investigate further.
   
   


-- 
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] arosien edited a comment on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien edited a comment on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1059447999


   I wasn't able to trigger a breakpoint at EDIFACT-SupplyChain-Segments-D.03B.xsd line 292 (under complexType`GIR-RelatedIdentificationNumbers`), but looking at the expected infoset for INVOIC_D.03B_Interchange_with_UNA.txt I don't see any `GIR` output.
   
   If instead I put a breakpoint at complex type `NAD-NameAndAddress` (EDIFACT-SupplyChain-Segments-D.03B.xsd:378; note this is the complexType tag, _not_ an element tag; also note that there are no breakpoints set in the -Segments* file), then a breakpoint **is** triggered:
   
   <img width="1402" alt="_Extension_Development_Host__-_EDIFACT-SupplyChain-Messages-D_03B_xsd_—_sampleWorkspace_and_logging_scala_—_daffodil-vscode" src="https://user-images.githubusercontent.com/31163/156827564-49132349-7014-4c1a-af59-628a49e30478.png">
   
   Note that the _encountered breakpoint_ is at the point where the "outer" schema (-Messages*) references the "inner" schema (-Segments) where the breakpoint is _defined_. Yes, this is somewhat weird, but the debugger is just relying on the location information from the Daffodil layers.
   
   So it seems we can break on external type definitions (only) when they match, and the referenced breakpoint location is at the use site, not the declaration site.
   
   Any thoughts?


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
mbeckerle commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058367731


   I can't get a breakpoint in any schema file beside the main one to work.
   
   To reproduce, use EDIFACT DFDL schema (from github)
   
   The main DFDL schema project file fo that is src/main/resources/EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Messages-D.03B.xsd
   
   The data file I chose was src/test/resources/EDIFACT-SupplyChain-D03B/TestData/INVOIC_D.03B_Interchange_with_UNA.txt
   
   Set breakpoint in src/main/resources/EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Segments-D.03B.xsd line 292.
   
   That should be hit during the parse, but never is. 


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058434498


   @mbeckerle How would I go about debugging this schema? I am getting an error about the schema, `EDIFACT-SupplyChain-D03B/EDIFACT-SupplyChain-Segments-D.03B.xsd`, not having any global components.


-- 
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 edited a comment on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell edited a comment on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1058374851


   @mbeckerle I believe if you look at the discussion of the PR, specifically https://github.com/apache/daffodil-vscode/pull/77#issuecomment-1029090526, @arosien states he could not find any schemas with breakpoint-able lines as most of the items were type definitions. So, @arosien can correct if me if I am wrong, but I think that is what you are seeing.
   


-- 
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 #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
Shanedell commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1017750707


   You actually don't need to have the jar in the class path if you have something like this it should also work
   
   ```
   "daffodilDebugClasspath": "/FULL/PATH/TO/dfdl-ethernet/src/main/resources:/FULL/PATH/TO/dfdl-pcap/src/main/resources"
   ```
   


-- 
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] arosien commented on issue #66: Multi-file Breakpoint

Posted by GitBox <gi...@apache.org>.
arosien commented on issue #66:
URL: https://github.com/apache/daffodil-vscode/issues/66#issuecomment-1028134291


   > Jars are the natural way schemas are packaged and obtained in Daffodil however, so this feature to be able to step into schemas where the source is in a jar is something we will want fairly soon. E.g., schemas being devloped now include 3 or 4 other schemas by way of jars on the classpath, so debugging there needs to support jars as first class.
   
   I filed #76 to support this.


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