maziac / DeZog

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

Attempts to start debugging result in error Cannot evaluate 'execAddress' #110

Closed vampirehunt2 closed 1 year ago

vampirehunt2 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a file called test.asm with the following contents:
    test_main:
    RET
  2. Assemble with sjasmplus:
    PS C:\8bit\git\aniol64ROM> C:\8bit\sjasmplus-1.20.2.win\sjasmplus.exe --raw=c:\8bit\git\aniol64ROM\test\test.bin --sld=c:\8bit\git\aniol64ROM\test\test.sld c:\8bit\git\aniol64ROM\test\test.asm
    SjASMPlus Z80 Cross-Assembler v1.20.2 (https://github.com/z00m128/sjasmplus)
    warning: missing  --fullpath  with  --sld  may produce incomplete file paths.
    Pass 1 complete (0 errors)
    Pass 2 complete (0 errors)
    Pass 3 complete
    Errors: 0, warnings: 1, compiled: 7 lines, work time: 0.015 seconds
  3. Create launch.json:

    {
    "configurations": [
    
    {
        "type": "dezog",
        "request": "launch",
        "name": "Simulator - Bare Z80",
        "remoteType": "zsim",
        "zsim": {
            "visualMemory": true,
            "memoryModel": "RAM"
        },
        "sjasmplus": [
            {
                "path": "C:/8bit/git/aniol64ROM/test/test.sld"
            }
        ],
        "commandsAfterLaunch": ["-mv 0x8700 100"],
        "history": {
            "reverseDebugInstructionCount": 1000000,
            "spotCount": 10,
            "codeCoverageEnabled": false
        },
        "startAutomatically": false,
        "rootFolder": "${workspaceFolder}",
        "loadObjs": [
            { "path": "C:/8bit/git/aniol64ROM/test/test.bin", "start": "0x0000" },
            { "path": "source.apl", "start": "0xC000" }
        ],
        "execAddress": "test_main", 
        "topOfStack": "0xBFFF"
    }
    ]
    }
  4. Click Run > Start Debugging

Expected behavior A debugging session starts with the PC initialised to test_main

Screenshots image

Version etc. (please complete the following information):

Notes:

maziac commented 1 year ago

There're currently some severe problems with the 3.2.2 version. Could you re-test with 3.2.1 jus to see if it is related.

maziac commented 1 year ago

I just released 3.2.3 to the market place. Please let me know if the problem persists.

maziac commented 1 year ago

OK. No need to do any further tests. The problem is twofold:

  1. the SLD file is empty because the assembly file lacks a DEVICE statement. Use:
    
    DEVICE NOSLOT64K

test_main: RET


2. There is an error in the dezog:
The exec_address is evaluated before the sld file is parsed. I.e. test_main is not known at this point.

Will work on a solution. Meanwhile please use '"exec_address:" 0'.
maziac commented 1 year ago

Please try this fix: dezog-3.2.3-rc1.vsix.zip

vampirehunt2 commented 1 year ago

Thank you. I don't think it's a problem with my assembly. I omitted this in my example (not knowing it was important), but in my actual program, the very first line in my main file is
device NOSLOT64K

A workaround I found is to set exec address to 0x0000 (or any hex address, instead of a label), save, run, then change back to the label, save and run.

I will upgrade to 3.2.3 shortly. I appreciate the support.

vampirehunt2 commented 1 year ago

I upgraded to 3.2.3 from the Marketplace and still have the same issue.

maziac commented 1 year ago

You need to upgrade to 3.2.3-rc1 that I attach few comments above. Unzip and 'Install from vsix...".