maziac / DeZog

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

Regression: can't use $00 syntax on breakpoints or console #43

Closed remy closed 3 years ago

remy commented 3 years ago

Describe the bug

Using $ as a hex prefix value does not work, i.e. I can't refer to 255 as $ff anymore.

To Reproduce Steps to reproduce the behavior:

  1. Start debugging
  2. In the debug console type: -mv $c000 $ff
  3. See error (screenshot below)

Expected behavior

This was/is working in 2.0.3

Screenshots

Screenshot 2021-01-05 at 17 42 27

Version etc. (please complete the following information):


Side note, I'm looking through the diff on the develop branch to see if I can see where the change is but thus far can't see it. I wonder if it's somewhere in src/misc/utility.ts file as the error in the debug console refers to a eval fail and I suspect this line which suggests the replaceVarsWithValues has a regression in it - but again, I can't see this in the diff…

remy commented 3 years ago

Not tested it yet, but it could be this commit

maziac commented 3 years ago

Yes, that's it. The regex was broken. I corrected it on 'develop' branch.

remy commented 3 years ago

Theory:

This is the difference in the utility.ts commit that tweaked the regexp:

Screenshot 2021-01-05 at 18 06 05

So previously when $ff went in, it came out the same, but the new regexp returns ff.

That value then goes into Utility.parseValue (here) and the value is no longer prefixed with $ and it doesn't match a label, so the value is returned as is - which eventually throws an error further down the chain.

maziac commented 3 years ago

Please try the new v2.1.3: https://github.com/maziac/DeZog/releases/tag/v2.1.3

remy commented 3 years ago

Works perfectly - thank you 🙏