Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z80CPU Error: TypeError: Cannot read properties of undefined (reading 'start') #107

Closed
CasperDev opened this issue Feb 16, 2023 · 4 comments

Comments

@CasperDev
Copy link

Changing PC register in active debug session corrupt session. Next click on StepIn or StepOver throws Z80CPU Error: TypeError: Cannot read properties of undefined (reading 'start') and makes debug session unable to continue.

Steps to reproduce the behavior:

  1. Clone example repo (https://github.com/maziac/z80-sample-program)
  2. Open in VSCode folder z80-sample-program
  3. Run Build task
  4. Start debug session (cursor stops at line 60 as expected)
  5. Press F10 twice (StepOver) - cursor advances to line 64 and Z80 registers change as expected
  6. Change PC register from 8004h to 8007h - cursor advances to next instruction at line 65 as expected
  7. Press F10 or StepOver button - session crashes and above error is shown in debug console.

Expected behavior
After changing PC register internal simulator should resume debug from new address stored in PC register (as reflected by cursor position on screen)

Version etc. (please complete the following information):

  • DeZog SW Version: 3.2.0
  • OS: Windows 10, Window Server 2019
  • Remote: zsim (Internal Simulator)

Additional context
Project files as cloned from https://github.com/maziac/z80-sample-program today.
All files including task.json and launch.json uses as is from above repo w/o any modification.

I believe this bug existed quite long. Tested also with Dezog 2.0

@maziac
Copy link
Owner

maziac commented Feb 16, 2023

I could reproduce the described. Thanks for reporting.
Seems the bug is happening only for the internal zsim. I tested with e.g. CSpect: there it works correctly. (And that's why it most probably slipped through...)

maziac added a commit that referenced this issue Feb 16, 2023
@maziac
Copy link
Owner

maziac commented Feb 16, 2023

Could you please try out this fix.
dezog-3.2.1-rc1.vsix.zip

@CasperDev
Copy link
Author

I can confirm that bug is fixed.
Also FYI another issue (I didn't posted) is fixed too. It was about changing register value when I couldn't write "8007h" but I was forced to use C format like "0x8007" - but like I said it's fixed now.
I'm trying to use your awesome tools to develop software for non ZX computer (Sanyo Laser 210/ Dick Smith VZ200 and family) so you can expect more voice from me.

@maziac
Copy link
Owner

maziac commented Feb 17, 2023

"Also FYI another issue (I didn't posted) is fixed too"
That's because I used a converter function now that is also used in other places in DeZog.
You could furthermore also use label names as input or e.g. "DE" for the register DE or SP for the stack pointer etc.

"to develop software for non ZX computer"
Yes, please do so and let me know if you run into any trouble.
Maybe 2 hints:

  1. with the "customMemory" (launch.json) you can setup your customized memory layout
  2. with "customCode" you can even setup/simulate some peripherals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants