apache / daffodil-vscode

Apache Daffodilâ„¢ Extension for Visual Studio Code
https://daffodil.apache.org/
Apache License 2.0
11 stars 19 forks source link

Execution not stopping at breakpoints #968

Closed lrbarber closed 6 months ago

lrbarber commented 7 months ago

Set a breakpoint on a line that execution stops at while stepping through the parse, but the breakpoint is not hit when I just let it run via Continue(F5)

google.png launch.json

Couldn't attach xsd file without renaming it png.dfdl.txt

lrbarber commented 7 months ago

Looking at the Dapodil history dumped into the terminal window, it seems that the breakpoints are being passed over from VS and accepted/acknowledged by the debugger.

rthomas320 commented 6 months ago

I ran the debugger with the same schema file png.dfdl.xsd and the same data file google.png in windows 10 and in Rocky 9. I set the log for the debugger to DEBUG in both instances. Below are some screen captures from BeyondCompare. The Windows log is on the left, the Rocky 9 log is on the right. image

image

image

I also attached the log files. Windows10-daffodil-debugger.log Rocky9-daffodil-debugger.log

nlewis05 commented 6 months ago

@arosien Are you able to take a look at this?

arosien commented 6 months ago

@arosien Are you able to take a look at this?

Sure, will look today. It looks... odd.

arosien commented 6 months ago

@lrbarber are you on Windows 9, or is that a different reproduction that @rthomas320 is showing?

For @rthomas320's Windows 9 problem, I suspect that the "is the current schema line in the list of breakpoints" check is failing due to the backslash path convention. The code looks like https://github.com/apache/daffodil-vscode/blob/main/debugger/src/main/scala/org.apache.daffodil.debugger.dap/DAPodil.scala#L754. I don't have a way to run Windows 9, but one could add some logging locally to test these comparisons, or we can try to find a Windows 9 Github action runner.

lrbarber commented 6 months ago

Rege and I are both on Windows 10.

Here's the info I see when I set a breakpoint:

2024-03-11 16:11:56,608 [io-compute-2] INFO o.a.d.d.d.DAPSession - R> #22 setBreakpoints {"source":{"name":"scpi.dfdl.xsd","path":"c:\Users\larry.barber\Documents\PaxRiver\scpi.dfdl.xsd","sourceReference":0},"lines":[41],"breakpoints":[{"line":41}],"sourceModified":false} 2024-03-11 16:11:56,612 [io-compute-6] INFO o.a.d.d.d.DAPSession - <R #22 setBreakpoints success {"breakpoints":[{"id":0,"verified":true,"line":41,"message":""}]}

@arosien You say these slashes are wrong and that could cause the problem?

arosien commented 6 months ago

Rege and I are both on Windows 10.

Here's the info I see when I set a breakpoint:

2024-03-11 16:11:56,608 [io-compute-2] INFO o.a.d.d.d.DAPSession - R> #22 setBreakpoints {"source":{"name":"scpi.dfdl.xsd","path":"c:\Users\larry.barber\Documents\PaxRiver\scpi.dfdl.xsd","sourceReference":0},"lines":[41],"breakpoints":[{"line":41}],"sourceModified":false} 2024-03-11 16:11:56,612 [io-compute-6] INFO o.a.d.d.d.DAPSession - <R #22 setBreakpoints success {"breakpoints":[{"id":0,"verified":true,"line":41,"message":""}]}

@arosien You say these slashes are wrong and that could cause the problem?

Not wrong, per se, but the normalization and comparison of the path into URIs may be implemented incorrectly for Windows-style paths. (See previous link to source.) I'll see if I can get a test case failing with the sample paths you've both provided.

nlewis05 commented 6 months ago

Rege and I are both on Windows 10. Here's the info I see when I set a breakpoint: 2024-03-11 16:11:56,608 [io-compute-2] INFO o.a.d.d.d.DAPSession - R> #22 setBreakpoints {"source":{"name":"scpi.dfdl.xsd","path":"c:\Users\larry.barber\Documents\PaxRiver\scpi.dfdl.xsd","sourceReference":0},"lines":[41],"breakpoints":[{"line":41}],"sourceModified":false} 2024-03-11 16:11:56,612 [io-compute-6] INFO o.a.d.d.d.DAPSession - <R #22 setBreakpoints success {"breakpoints":[{"id":0,"verified":true,"line":41,"message":""}]} @arosien You say these slashes are wrong and that could cause the problem?

Not wrong, per se, but the normalization and comparison of the path into URIs may be implemented incorrectly for Windows-style paths. (See previous link to source.) I'll see if I can get a test case failing with the sample paths you've both provided.

You have any comments on how this should be implemented? https://github.com/apache/daffodil-vscode/pull/990#discussion_r1521575132