maziac / DeZog

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

srcPath appears to need an absolute path. (Fixed in 3.0) #96

Closed cdoty closed 1 year ago

cdoty commented 1 year ago

Describe the bug Setting a directory, relative to the base directory, does not allow setting breakpoints in files located outside of the base directory.

To Reproduce Using sjasmplus, I have assembled my code with either --fullpath added or removed and using SLD files. My code includes files from "../Shared". I set "srcDirs": ["../Shared"]. "srcDirs": [], "srcDirs": [""] or"srcDirs": ["."] does not fix the issue Setting breakpoints in any file in "../Shared" does not work. The only way breakpoints work is if I include the the absolute path to the Shared folder.

Version etc. (please complete the following information):

Additional context If possible please attach your complete Z80 project as a zip file. It should also include the .vscode folder with the launch.json file and the list (.lst) file.

cdoty commented 1 year ago

Added Test.zip

maziac commented 1 year ago

I have a fix for that. Please try dezog-2.7.4-rc1.vsix. You find it here: https://github.com/maziac/DeZog/releases/edit/v2.7.3

I didn't knew that someone is trying to debug the coleco system with DeZog.

You have a launch.json entry also for MAME. MAME support is kind of experimental at the moment. What are you experiences? Does it work for you?

cdoty commented 1 year ago

That works great. It was a project that I picked from my Github project (https://github.com/cdoty/9918-Adventures) to try out debugging. ZEsarUX supports a lot of TMS-9918a based targets, which is nice.

The launch just launches the MAME debugger. I will set it up to test it with Dezog though.

cdoty commented 1 year ago

The Mame version worked fine also. I'm using Windows, so I had to add a pause in the do while loop to allow the compiler to rebuild the program. For some reason Mame keeps the rom files open.

maziac commented 1 year ago

Oh, that's a good finding. How long you need to pause / can you put your command line here.

The gdbstub in MAME is, unfortunately, not reconnecting. Having disconnected once, you need to restart MAME. Therefore I'm thinking of providing a lua gdbstub. Would also enable more features.

cdoty commented 1 year ago

I just used "pause" in a Windows bat file. It will pause until a key is pressed.

In VS code, I exit out of MAME, recompile the code, and press a key in the window running the MAME bat file:

set WORKING_DIRECTORY=%cd%

cd \mame :while mame coleco -window -debugger gdbstub -debug -debugger_port 12000 -verbose -cart %WORKING_DIRECTORY%\Game.col pause @GOTO while

cd %WORKING_DIRECTORY%