Closed mnunesvsc closed 4 years ago
Could you attach your project here, so I can reproduce.
I looked at your launch.json. Maybe that helps already.
"sources" is not used at all anymore by DeZog. I have now seen that it is still included in the configuration snippet, so I will remove it there.
In the raiz configuration you didn't put in any "mainFile". I guess this is the reason why you cannot do source-level debugging.
In the Speccy Trom configuration I have seen that you put in "mainFile": "speccytron.c" This is a c-file I guess. So I don't think that it can work. DeZog expect asm sources here. If it really works please let me know, this was unintended (but would be really great).
Wow, thanks for the answers, i did was told, but not loading, but i got a different error, please not pay attention to the others launch options, "Raiz" is the only used
sorry the picture not go complete
If that didn't help then please provide me with the project or some minimal test program. (I did test my z88dk test project and that was working).
Luckyly speccy is small :) if in need of anything more tell me
by the way this is reporting too, this error, some parameter on start
Hi, I got it working somehow:
You need to change your listFiles section such:
"listFiles": [
{
"path": "efd.c.lis",
"useFiles": false,
"asm": "z88dk",
//"mainFile": "efd.c.lis",
"addOffset": 25124,
"srcDirs": [] }
],
Explanation: You don't have asm source files only an assembler list file therefore you have to choose "useFiles": false. This means: your list file only, no assembler source files. Furthermore remove "mainFile". This is normally the main assembler source file. You have none so nothing should be specified here. Then: It is working, i.e. it uses your list file and shows it, i.e. you can step. But the lines do not match what you see in the "Disassembly" view. This probably means that your offset ("addOffset") is wrong. Maybe you need to experiment with other values here. Or maybe the tap file didn't exactly match the included list file.
You are currently using a tap file as output. That is fine. But it requires zesarux to go through the ZX ROM and "load" the file. If you have the chance to use the SNA or NEX file format this would not be required, i.e. the loading works more smooth.
Further note: I didn't see the "Illegal operation" or ZEsarUX errors. But I'm working on macOS. If it persists for you please report.
Aah, I forgot: It's normal that you start with a disassembly at 0000h. This is because of that tap loading. You would need to put a breakpoint somewhere in your list file and run from 0000h.
Did the instructions, and if on debbug i do an step, it goes to the file, but as long i hit go and pause he got back to disasm, i generated the .sna and changed the launch, sending again
I have success in setting a breakpoint in file and the debbug stoped right, but if i dig into, he cannot find the lib ( dbalib.c.lis ) and show me a fuzzy code ( not the one in .c.lis ) and return.
pointg that because it is the routine i need to know why is not workig :)
sorry for the trouble.
the code is the same, of the previously comment.
more info, if i change the asm from;
z80asm
to
z88dk
it cannot set the breakpoints, nor show the main c.lis file, only works for me with z80asm, and it is the only option in sugestion.
hope this could help
The z80asm option is for Savannah's z80asm. For z88dk use "z88dk". Unfortunately z88dk used the same name for its assembler.
I think I need some more time to sort this out. It has something to do with the "addOffset". Do you know what the ORG for your source code is, e.g. where the _loadlevel is supposed to be?
The list files of z88dk are not very easy to read as all sections start at 0000h although they are located at some real addresses.
Thankyou for the help, unfortunally i do not possess the knowledge of the inards of the z88dk, but the only thing out of the code, c.lis is the pragma i used hope this help somehow
// definitions
// COMPILE TIME CRT CONFIGURATION
// #pragma output CRT_ORG_CODE = 32768 // org 32768
// #pragma output CRT_ON_EXIT = 0x30002 // return to basic on exit
// CREATE A BLOCK MEMORY ALLOCATOR WITH ONE QUEUE // #pragma output CLIB_BALLOC_TABLE_SIZE = 1
And the command line i use to compile the code, if i can be of any more help.
set PATH=C:\z88dk\bin;%PATH% set ZCCCFG=C:\z88dk\lib\config set TEMP=.temp set TMP=.temp
rem compile all
zcc +zx -vn --opt-code-speed -SO3 -clib=sdcc_iy -startup=31 --max-allocs-per-node2000 @efd.lst -m --list --c-code-in-asm -oefd -create-app -Cz"--sna"
What seems to work is the address offset 30520
"listFiles": [
{
"path": "efd.c.lis",
"useFiles": false,
"asm": "z88dk",
// "mainFile": "efd.c.lis",
"addOffset": 30520, //25281,
"srcDirs": []
}
I have taken it from the lis and map file. The code section in the lis file starts with _loadlevel. The lis file includes only relative addresses so it starts with address 0000. The map file shows that this maps to $7738 which is 30520.
Start the debug session, you land in some disassembled code.
Set a breakpoint at '_main' in your lis file.
Do a 'run'.
You will end up here in the lis file:
Although this seems to work for the code section there is a problem with the other labels. I.e. the data labels like _off_screen also start at relative address 0000. The offset is added to them as well. This results in _off_screen == _loadlevel which is not true if you look at the map file. I.e. you can't rely on the label resolution for your data.
I will need to think a bit if I can work around this (otherwise I need to drop official support for z88dk).
I have created a new release v1.1.1, please get it here: https://github.com/maziac/DeZog/releases/tag/v1.1.1
Please download and install via the vscode command palette (Press F1) and choose "Extensions: install from VSIX...".
The addresses now seem to work correctly but you need to add a new parameter. Use this:
"listFiles": [
{
"path": "efd.c.lis",
"asm": "z88dk",
"srcDirs": [],
"z88dkMapFile": "efd.map"
}
],
I.e. the map file is added here. It allows to associate the labels with the line numbers in the lis file. The "addOffset" is gone. Don't use it together with "z88dkMapFile". It will not work.
As before: Start the debug session, you land in some disassembled code. Set a breakpoint at '_main' in your lis file. Do a 'run'.
Now you should be in your lis file instead of the disasm.asm.
Testing the release, if i use z88dk this happen.
if i use z80asm the c.lis is not loaded, even if i set a breakpoint.
P.S. Again the warning for the parameter; cpu-history ignorephalt yes => Error. Unknow parameter
As said, you need to remove "addOffset" completely. Please try again.
And: You don't need to tinker around with "z80asm". It is a different assembler.
does not even start, works only with z80asm, appear to be some file in fault, wanna see my machine with skype ?
mine´s : mnunesvsc
I don't think that Skype will help. I need to debug the problem. Could you once again zip your project.
I don't think that Skype will help. I need to debug the problem. Could you once again zip your project.
i did, on a post before, it is on a zip, + map, and lis
I could reproduce it now. You are missing the "srcDirs": [] from my post.
Please use exactly this "listFiles" properties. No additions, no left outs:
"listFiles": [
{
"path": "efd.c.lis",
"asm": "z88dk",
"srcDirs": [],
"z88dkMapFile": "efd.map"
}
],
nope..
directly to disasm, do not even open the .clis file
can be any relation with that rootdir ? what appear to be is that he can not find the file
I prepared a new release https://github.com/maziac/DeZog/releases/tag/v1.1.2-pre1 to make sure that we are working with exactly the same version.
If that does not help then please send me your zipped project once again. There must be something different. Your old project is working fine for me now.
The zip is missing the .vscode folder, i.e. the launch.json.
My bad, here goes
I could change it so that it works. Again: Don't use "z80asm". This property is used for Savannah's assembler listing syntax. It has nothing in common with z88dk-z80asm besides the name. For z88dk-z80asm use "z88dk".
That was in fact the only line that I changed. Here is an animated gif and I attached the changed project below.
This is what happens to me
Interesting issue. I have now run into a similar problem: sometimes, when I set an breakpoint it is not set, i.e. it is "unverified". That means the Z80-address to file-line association has gone wrong. Have you really used the speccytron.zip that I attached. Especially rootFolder should be "${workspaceFolder}"?
I have prepared a new version 1.1.2-pre2 here which has additional debug output: https://github.com/maziac/DeZog/releases/tag/v1.1.2-pre2
Could you please install it, make sure all files are saved and start a debug session.
Then at line 1498 (push ix)
set a breakpoint and make a screenshot of the DEBUG CONSOLE.
You should get something similar to this:
The initial operation worked as predicted, BUT....
as the images shows no output on the screen, on the output tab
and as i pause, on the interface, they return to the disasm.asm
if i restart the code, and all the "stage" is maintened, the step over works on c.lis, but as i hit the continue and go back , returns on disasm, it is after the communication with the zesaur ( i thougth so )
hope this help
Actually this looks good.
- "as the images shows no output on the screen, on the output tab": This is because you are on the OUTPUT tab. Please change to the DEBUG CONSOLE to see the output I meant (the output when setting a breakpoint). But as I can see the breakpoints are verified now. I.e. working correctly. So the output would not help here. But please, as soon as you run into this problem again (a breakpoint cannot be set in your lis file) then check the DEBUG CONSOLE and send me a screenshot. I suspect that sometimes something is going wrong there.
- "and as i pause, on the interface, they return to the disasm.asm": This is correct behavior. It is simply because there is no source code provided for that memory area. In that case the internal disassembler jumps in and shows the disasm.asm code. Have a look at your efd.c.lis file and search e.g. for "_drawSpriteM". It is used by some calls but not defined in end.c.lis. Thus DeZog does not know about it. Luckily you can tell DeZog to use several list files like so:
"listFiles": [
{
"path": "efd.c.lis",
"asm": "z88dk",
"srcDirs": [],
"z88dkMapFile": "efd.map"
},
{
"path": "dbalib.c.lis",
"asm": "z88dk",
"srcDirs": [],
"z88dkMapFile": "efd.map"
}
],
"_drawSpriteM" is included in "dbalib.c.lis" and now DeZog can find it.
If you now do a break you probably land in known source code.
If you have more lis files you should add them probably as well.
WORKED like a charm, sorry for all the trouble
goes inside the other lib, AWESOME
thank you for the hard work and the excellent tool.
anything i can be of help, drop me a mail mnunesvsc@protonmail.com
That's nice to hear. And thanks for your support as well. This made the z88dk support a bit better.
And thanks for the offer. Any testing is always appreciated.
Thanks for the fast responses, and hard working, closing the issue
Hi, I have followed this interesting and useful thread because I am trying to use DeZog with z88dk.
With the hints and explanations in this thread I have been able to prepare an environment for compiling and debugging my z88dk projects, but there is still a problem that I am not able to solve: even if I am including the .map and .lis files in my launch.json, I can see the code listing while I am debugging, but all the breakpoints are always unverified.
Here is the error I get in the Debug console:
Unverified breakpoint:{"verified":false,"line":996,"column":0,"source":{"name":"TestLists2.c.lis","path":"n:\DGT_LIB\Examples\TestLists2\Sources\TestLists2.c.lis","sourceReference":0}}
and attached you can find my project (the folder that has to be opened with VSC is "N:\DGT_LIB\Examples\TestLists2").
I am sure I am making something wrong, but I don't know what.
Thank you in advance for any help you can give here.
Hi, I can have a look but your zip misses the .vscode folders, I think. Could you include them as well. Regards.
Hi @maziac you are right, sorry.
Here is the .zip file again with the .vscode folder included. You can find it in N:\DGT_LIB\Examples\TestLists2
Thanks
I tested it now but I don't think there is any problem with your setup. I was able to set breakpoints. Maybe you used the wrong file. Don't set the breakpoints in the TestLists2.lis file but e.g. in TestLists2.c.lis.
When I startup I end up here. That's some preamble code of your compiler.
Now goto TestLists2.c.lis and set a breakpoint e.g. beneath _main:
It should work.
Press start and you should break at _main.
Well, this is exactly what I am doing. I start the debugging session and land in the compiler preamble:
Then I open the TestLists2.c.lis file and try to set a breakpoint, but it is always invalid:
TestLists2.lis file is completely different and doesn't contain the _main entrypoint, in fact I don't use it.
It is really strange that the same setup that doesn't work for me works like a charm on your computer.
I am using a portable version of VSC 1.45.0, but I don't think that it can be the problem.
Strange. The only thing I changed were the path slashes because I‘m on macos. Could you check if the paths are correct. You could also try changing all \\ to / in launch.json. I think vscode can deal with it.
So, I have finally found a way. I have tried to change the path slashes as you suggested, but it didn't work. I have then removed some ${workspaceRoot} from tasks.json and launch.json and now my breakpoints are verified :-)
Here are the new working task.json and launch.json
I don't know why I had to remove those ${workspaceRoot} to get the debugger work, but it works and that's enough for me ;-)
Thank you for your help!
Should you need mine for some test, please ask and I will be happy to help.
Good to know that it works now. As it worked for me it seems that these are different in windows and mac.
Have fun with DeZog.
Hi @maziac ,
I have updated all the z88dk and vscode/dezog environment after some (long) time but it seems that the long gone problem with the c.lis files from z88dk has raised again.
In fact I am receiving this error
'dezogif v2.1.0' initialized. Unverified breakpoint: {"verified":false,"line":7,"column":0,"source":{"name":"Test.c","path":"d:/TEST_C/Test.c","sourceReference":0}} Additional info: Address not found for d:/TEST_C/Test.c
on a very simple C program that you can find in the attached zip file
I am using the latest z88dk version (2.2)
Thank you in advance for any help you could give here.
The TEST_C.zip does not contain the .vscode folder. Could you please add.
Can I use your code (TEST_C.zip) as a test case inside DeZog? It is just a small code snippet but can you put it under MIT license.
Of course! You can use the TEST_C.zip for whatever you want! I am not sure I can add any MIT license on the Test.c file: it is just an "Hello World" example...
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
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": [
}