maziac / DeZog

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

c.lis file never being used, always auto disasm.asm #17

Closed mnunesvsc closed 4 years ago

mnunesvsc commented 4 years ago

Anytime i try to debug a code, compiled on z88dk, and running, the disassemble not use the c.lis generated, some early versions it worked, but not anymore

image

follows my launch options, early versions, if i change asm: option

it worked, and no change in files or sources do the slight difference.

i put the complete launch, but the one with the issue is;

DeZog raiz

{ // Verwendet IntelliSense zum Ermitteln möglicher Attribute. // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [

    {
        "type": "dezog",
        "request": "launch",
        "name": "DeZog raiz",
        "remoteType": "zrcp",
        "zrcp": {
            "hostname": "localhost",
            "port": 12000
        },
        "zsim": {
            "machine": "48k"
        },
        "serial": {
            "baudrate": 230400,
            "port": "/dev/tty.usbserial"
        },
        // "topOfStack": "stack_top",
        "listFiles": [
            {
                "sources": "efd.c.lis",
                "useFiles": true,
                "asm": "z88dk",
                "srcDirs": [],
                "path": "efd.c.lis",
            }
        ],
        "disassemblerArgs": {
            "esxdosRst": true
        },
        "load": "efd.tap",
        "skipInterrupt": true
    },

    {
        "type": "dezog",
        "request": "launch",
        "name": "Speccy Tron",
        "remoteType": "zrcp",
        "zrcp": {
            "hostname": "localhost",
            "port": 12000
        },            
        "listFiles": [
            {
                "path": "speccytron.c.lis",
                "sources": "speccytron.c.lis",
                "useFiles": true,
                "asm": "z88dk",
                "mainFile": "speccytron.c",
                "srcDirs": [],
                "addOffset": 32768
            }
        ],
        "startAutomatically": false,
        "skipInterrupt": true,
        "commandsAfterLaunch": [
            //"-sprites",
            //"-patterns"
        ],
        "disassemblerArgs": {
            "esxdosRst": true
        },
        "rootFolder": "${workspaceFolder}",
        "load": "speccytron5.tap",
        // "load": "4.Z80",
        "smallValuesMaximum": 512,
        "tmpDir": ".tmp"
   },
   {
    "type": "dezog",
    "request": "launch",
    "name": "efd",
    "remoteType": "zrcp",
    "zrcp": {
        "hostname": "localhost",
        "port": 12000
    },            
    "listFiles": [
        {
            "path": "efd.c.lis",
            // "sources": "efd.c",
            "useFiles": true,
            "asm": "z80asm",
            // "listfiles": "efd.c.lis, dbalib.c.lis",
            "mainFile": "efd.c.lis",
            // "srcDirs": [],
            "addOffset": 25124
        }
    ],
    "startAutomatically": false,
    "skipInterrupt": true,
    "commandsAfterLaunch": [
        //"-sprites",
        //"-patterns"
    ],
    "disassemblerArgs": {
        "esxdosRst": true
    },
    "rootFolder": "${workspaceFolder}",
    "load": "efd.tap",
    "smallValuesMaximum": 512,
    "tmpDir": ".tmp"
}
]

}

maziac commented 1 year ago

I think your statement above in the comments is enough. Thanks.

maziac commented 1 year ago

I managed to get it working.

There is a zsim config in your launch.json that is still z88dk (version 1) but I guess you know that.

In the other config ("ZXNEXT") the "path" is set to "Test.lis" it should point to "Test.c.lis". Further, he "srcDirs" is set to [""] this will turn the parsing into the source file mode. I.e. it searches for the asm files that the z88dk c-compiler has created e.g "C:/Users/black/AppData/Local/Temp/zcc000053A8FE882.asm". The files are not there but anyhow we should use the list file mode, i.e. the "srcDirs" need to be changed to "[]" (no string inside).

That's for the configuration.

But still it will not work.

You used a z88dk compiler that produces an output for the addresses that uses 6 digits. The newest z88dk sources have corrected this, so dezog was only expecting 4 digits. Anyhow I now included this "dialect" in dezog as well. I.e. dezog can now deal with z88dk v2 output that uses either 4 digits or 6 digits for the addresses.

Pleases make these changes to your config, use the attached vsix and tell me if it works.

Here is the config part that I used:


        {
            "type": "dezog",
            "request": "launch",
            "name": "my zsim",
            "remoteType": "zsim",
            "zsim": {
               "memoryModel": "ZX48K"
            },
            "z88dkv2": [
                {
                    "path": "Test.c.lis",
                    "mapFile": "Test.map",
                    "srcDirs": []
                }
            ],
            "startAutomatically": false,
            "history": {
                "reverseDebugInstructionCount": 10000,
                "codeCoverageEnabled": true
            },
            "rootFolder": "${workspaceFolder}",
            //"topOfStack": "stack_top",
            "load": "Test.sna",
            "smallValuesMaximum": 513,
            "tmpDir": ".tmp"
        },

I used zsim for convenience, you can as well use the "zxnext". dezog-3.1.2-rc2.vsix.zip

Blackbelt61 commented 1 year ago

Unfortunately still doesn't work.

I have installed your lates vsix and just to be sure I now have only your suggested configuration in the launch.json, but still getting the same error.

image

Here is a new zip with the latest compiled files.

[Uploading TEST_C.zip…]()

I am using Windows 10

maziac commented 1 year ago

That should be OK. You need to step to call _main and step into. Then it will change to Test.c.lis and you can set a Breakpoint.

Blackbelt61 commented 1 year ago

Oh yes! It works :) I will try with some more complicated project: more files, libraries, etc.

Thanks a lot by now!