maziac / DeZog

Visual Studio Code Debugger for Z80/ZX Spectrum.
MIT License
217 stars 34 forks source link

Cspect: Breakpoint not hit on first instruction in interrupt handler #97

Closed taylorza closed 1 year ago

taylorza commented 2 years ago

Describe the bug This might be a CSpect issue as this does not occur when using serial debugging on real hardware. Setup NEXT IM2 hardware interrupts, in the interrupt handler put a breakpoint on the first instruction of the handler. The breakpoint is never hit. Moving the breakpoint to the second instruction works fine. It does not matter if the first instruction is a single or multibyte instruction.

To Reproduce Steps to reproduce the behavior:

  1. Load the CTC Sample project to debug in VS Code : https://gist.github.com/taylorza/5e0cd21acaba43e5369bb5270ed29d33
  2. Set a breakpoint on the first instruction in the ctc0handler, this is the instruction push af
  3. Launch the debugger and start running
  4. The breakpoint is not hit

Expected behavior The debugger to break into the code on the first instruction of the interrupt handler when the handler is executed.

Screenshots N/A

Version etc. (please complete the following information):

maziac commented 2 years ago

Could you maybe upload the complete project as a zip. You can attach it here in the issue. Best together with the .vscode/launch.son and also the sld and the nex file.

taylorza commented 2 years ago

I just added the project to the original post. There will be a few hardcoded paths you will need to edit, I need to still get that resolved in the tool I have to scaffold the projects :)

maziac commented 2 years ago

No problem.

I could reproduce the problem.

But it seems to be a CSpect issue. CSpect (2.16.5) behaves the same (it does not break at the interrupt address) if the breakpoint is set from within the CSpect debugger. We should contact Mike about it.

taylorza commented 2 years ago

I suspected as much, thanks for confirming.

maziac commented 2 years ago

Reopened until fixed in cspect.

taylorza commented 1 year ago

I was playing with this again in CSpect 2.17.0.0 and it looks like this issue has been fixed. I am not hitting breakpoints set on the first instruction in the interrupt handler.

maziac commented 1 year ago

I was playing with this again in CSpect 2.17.0.0 and it looks like this issue has been fixed. I am not hitting breakpoints set on the first instruction in the interrupt handler.

I am confused. Has it been fixed or not?

taylorza commented 1 year ago

:) Sorry, not should have been now... Yes, it appears to be fixed based on my testing.

maziac commented 1 year ago

Ahh, I see.

Can we close the issue now?

taylorza commented 1 year ago

It looks good to me, I will close the issue.