English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 12 November 2020, 01:20   #1
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Pre-release vscode amiga assembly with WinUAE integration

If some of you are interested in testing the extension with WinUAE integration, I've made a pre-release :
https://github.com/prb28/vscode-amig...eases/tag/0.21

I'll be glad to have some feedback to tackle the bugs.
prb28 is offline  
Old 12 November 2020, 10:38   #2
JoeJoe
Registered User
 
Join Date: Feb 2020
Location: Germany
Posts: 195
This is really awesome.When I am in debug mode and click with the mouse into the window of WinUAE I get this code in the VS code.

Pro:
- The feature "Step Out" at debugging works fine!
- Key Shift+F12 trigger the VSCode debugger

Bugs:
- Breakpoint at first line dont work
- mouse click in WinUAE stop at strange code
- Setting "stopOnEntry" not work
- Emulation reset not work as like as FS-UAE
Attached Thumbnails
Click image for larger version

Name:	debug_entry.png
Views:	220
Size:	54.8 KB
ID:	69658  

Last edited by JoeJoe; 12 November 2020 at 11:06. Reason: more content ;)
JoeJoe is offline  
Old 12 November 2020, 13:36   #3
Geijer
Oldtimer
 
Geijer's Avatar
 
Join Date: Nov 2010
Location: VXO / Sweden
Posts: 153
Cool, I got it running in Ubuntu 20.05 with wine 5.5!

But not without problems, can you implement a configurable delay before the extension tries to connect to WinUAE or retry after a short time? As it is now, it tries to connect to the port before WinUAE is up and listening to the port resulting in "connect ECONNREFUSED 127.0.0.1:2345"!
Geijer is offline  
Old 12 November 2020, 23:01   #4
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by JoeJoe View Post
When I am in debug mode and click with the mouse into the window of WinUAE I get this code in the VS code.
Do you have the exception breakpoint set ?
I think I should make the exception mask, configurable in the launch settings. I think it's some trigger launched at the click that is caught as an exception.

Quote:
Originally Posted by JoeJoe View Post
- The feature "Step Out" at debugging works fine!
Does work with FS-UAE too

Quote:
Originally Posted by JoeJoe View Post
- Key Shift+F12 trigger the VSCode debugger
I'll try this, it's a surprise for me !


Quote:
Originally Posted by JoeJoe View Post
Bugs:
- Breakpoint at first line dont work
- mouse click in WinUAE stop at strange code
- Setting "stopOnEntry" not work
- Emulation reset not work as like as FS-UAE
What do you mean by : "Emulation reset not work as like as FS-UAE" ?


Thanks for the test !
prb28 is offline  
Old 12 November 2020, 23:03   #5
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by Geijer View Post
Cool, I got it running in Ubuntu 20.05 with wine 5.5!



Quote:
Originally Posted by Geijer View Post
can you implement a configurable delay before the extension tries to connect to WinUAE or retry after a short time?
Yes, it's a good idea.


Thanks for the test !
prb28 is offline  
Old 12 November 2020, 23:18   #6
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
The example workspace works good. When I try and do my own project (a500 config from makefile) with what I think are the correct launch.json settings I get the "connect ECONREFUSED" message while the winuae is still booting up.
Edit: My launch.json below (and fsuae entries that work for debugging for comparing). I replaced my winuae.exe with yours and added a A500Debug.uae to point to correct ROMs etc. I call my exe "demo" so SYS: Demo launches it.

Code:
{
    "version": "0.2.0",
    "configurations": [
        {
		"type": "winuae",
		"request": "launch",
		"name": "WinUAE Debug",
		"buildWorkspace": false,
		"stopOnEntry": true,
		"serverName": "localhost",
		"serverPort": 2345,
		"startEmulator": true,
		"trace": true,
		"emulator": "${workspaceFolder}\\..\\..\\WinUAE\\winuae.exe",
		"emulatorWorkingDir": "${workspaceFolder}\\..\\..\\WinUAE",
		"program": "${workspaceFolder}\\dh0\\Demo",
		"options": [
		    "-config=A500Debug.UAE",
		    "-s",
		    "debugging_trigger=sys:Demo",
		    "-s",
		    "filesystem=rw,dh0:${workspaceFolder}\\dh0"
		]
	    },	    
        {
            "type": "fs-uae-run",
            "request": "launch",
            "name": "WINDOWS Run",
            "buildWorkspace": false,
            "emulator": "${workspaceFolder}\\..\\..\\ToolChain\\VSCodeExt-bin\\fs-uae.exe",
	    "emulatorWorkingDir": "${workspaceFolder}\\..\\..\\ToolChain\\VSCodeExt-bin",
            "options": [
                "--hard_drive_0=${workspaceFolder}\\dh0",
                "--joystick_port_1=none",
                "--amiga_model=A500",
                "--chip_memory=512",
                "--slow_memory=512",
                "--kickstarts-dir=${workspaceFolder}\\..\\..\\WinUAE\\Roms"
            ]
        },
        {
            "type": "fs-uae",
            "request": "launch",
            "name": "WINDOWS Debug",
            "stopOnEntry": true,
            "serverName": "localhost",
            "serverPort": 6860,
            "trace": false,
            "startEmulator": true,
            "buildWorkspace": false,
            "emulator": "${workspaceFolder}\\..\\..\\ToolChain\\VSCodeExt-bin\\fs-uae.exe",
	    "emulatorWorkingDir": "${workspaceFolder}\\..\\..\\ToolChain\\VSCodeExt-bin",
            "program": "${workspaceFolder}\\dh0\\Demo",
            "options": [
                "--hard_drive_0=${workspaceFolder}\\dh0",
                "--joystick_port_1=none",
                "--amiga_model=A4000/040",
                "--kickstarts-dir=${workspaceFolder}\\..\\..\\WinUAE\\Roms",
                "--remote_debugger=200",
                "--use_remote_debugger=true",
                "--automatic_input_grab=0"
            ]
        },
    ]
}

Last edited by Antiriad_UK; 12 November 2020 at 23:51.
Antiriad_UK is offline  
Old 13 November 2020, 00:07   #7
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
@Antiriad_uk
In your config A500Debug.uae you must add some options that are in the workspace\bin\default.uae file, at least :
debugging_features=gdbserver
.
I think the
sys:Demo
must be exactly the same command in the startup-sequence. (not sure, I did not try changing the path to see if it still works). It may work as the standard winuae debugger trigger.

edit : unwanted smilies
prb28 is offline  
Old 13 November 2020, 15:26   #8
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by prb28 View Post
@Antiriad_uk
In your config A500Debug.uae you must add some options that are in the workspace\bin\default.uae file, at least :
debugging_features=gdbserver
.
I think the
sys:Demo
must be exactly the same command in the startup-sequence. (not sure, I did not try changing the path to see if it still works). It may work as the standard winuae debugger trigger.

edit : unwanted smilies
Great. That got it working better. It's now connecting and breaking on exception (level 3 routine). It's not breaking at any other breakpoint though. I'll keep playing.
Antiriad_UK is offline  
Old 14 November 2020, 01:49   #9
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
New "pre" version at the same place :
- StopOnEntry fixed.
- Use of UAEexit at the end of the example program startup-sequence.
- New launch parameters :
*"exceptionMask": 8188,
*"emulatorStartDelay": 1500
NB: There is something wrong with my gencop example program, it does not exits to the cli normally.
prb28 is offline  
Old 15 November 2020, 21:41   #10
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Still having some issues with this. If stoponentry is true then it stops on entry and I can single step through the source ok. But if I try and stop on a custom breakpoint the program pauses but doesn't show anything in the source and the CPU call stack says "error during frame selection: 0"

Edit: Hmm actually 0.21 breaks the fsuae debug as well. If I roll back to 0.20 it works again.
Edit: I'll zip up a test project and PM you the details. Probably easier!

Last edited by Antiriad_UK; 15 November 2020 at 22:24.
Antiriad_UK is offline  
Old 18 November 2020, 23:58   #11
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
New pre-release to fix the bugs found by Antiriad_UK : https://github.com/prb28/vscode-amig.../tag/0.21_pre3.
prb28 is offline  
Old 19 November 2020, 10:38   #12
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Quote:
Originally Posted by prb28 View Post
New pre-release to fix the bugs found by Antiriad_UK : https://github.com/prb28/vscode-amig.../tag/0.21_pre3.
Hi! I've tested on my previous project. I updated 'bin' folder, added 'launch' section to my existing launch.json (+ tweaked default.uae by adding 1mb fast ram ;-)) and installed amiga-assembly-0.21.0.vsix to VSCode.
Everything works just fine for me.
WinUAE launches, my Amiga executable runs, breakpoints trigger, stepping in code works.
So far I've encountered only one minor issue: When I place a breakpoint, the executable stops but at a different location (yet inside my code). If I press continue then it stops at the correct breakpoint. when I remove my breakpoint and later add it back again, the behaviour repeats.
No big issue -- just an annoyance :-)
The fact that using WinUAE allows me to run my code at the normal speed under the debugger is just great (emulation is slowed down under fs-uae when debugging). Thank you! Your addon is just the pure gold!

Last edited by defor; 19 November 2020 at 13:53.
defor is offline  
Old 19 November 2020, 10:55   #13
JoeJoe
Registered User
 
Join Date: Feb 2020
Location: Germany
Posts: 195
I can only agree that now the extension works. My reported errors are no longer occurring. Thank you very much for that!

Is there a possibility to display the performance per frame like the "c extension" of BartmanAbyss?
JoeJoe is offline  
Old 19 November 2020, 20:09   #14
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by defor View Post
So far I've encountered only one minor issue: When I place a breakpoint, the executable stops but at a different location (yet inside my code). If I press continue then it stops at the correct breakpoint. when I remove my breakpoint and later add it back again, the behaviour repeats.
No big issue -- just an annoyance :-)
Yes I see that behaviour too.
Antiriad_UK is offline  
Old 19 November 2020, 21:43   #15
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by Antiriad_UK View Post
Yes I see that behaviour too.
Do you have it in the code you sent ?
If yes can you tell me where to put my breakpoint ?


if not, @defor do you a have little example ?


@JoeJoe, yes it's in my mind, I'll ask bartman if I can copy/paste some code.
prb28 is offline  
Old 19 November 2020, 21:57   #16
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Yes it happens in the code I sent. For it to occur the program must be running:
1. Set no breakpoints
2. Run code under debug
3. Whilst running create a new breakpoint in the level3 int handler in template.asm (say line 360)
4. Will jump into the debugger at a "random" line
5. Press f5 once
6 Will now be at the correct breakpoint
Antiriad_UK is offline  
Old 20 November 2020, 00:20   #17
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
@antiriad thanks, I can reproduce it.
prb28 is offline  
Old 20 November 2020, 10:59   #18
JoeJoe
Registered User
 
Join Date: Feb 2020
Location: Germany
Posts: 195
The parameter "exceptionMask" is really cool! Can the pointer to the command that caused the error be positioned correctly? But I think that this is not so easy.



Is this also possible for the FS-UAE version?

Here again a few wishes:
- memory breakpoints
- Reset Emulator (For FS-UAE it is ALT-R/T)

Thanks and greetings
JoeJoe
Attached Thumbnails
Click image for larger version

Name:	exceptionMask_pos_wrong.png
Views:	645
Size:	53.2 KB
ID:	69770  
JoeJoe is offline  
Old 22 November 2020, 00:59   #19
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
Quote:
Originally Posted by JoeJoe View Post
Can the pointer to the command that caused the error be positioned correctly?
Thant would be better , but I must look what's happening in winuae.


Quote:
Originally Posted by JoeJoe View Post
Is this also possible for the FS-UAE version?
Yes The mask parameter can be added to fsuae too. And it's already done in the version you have. Just add it to the launch parameters of fsuae.


Quote:
Originally Posted by JoeJoe View Post
Here again a few wishes:
- memory breakpoints
- Reset Emulator (For FS-UAE it is ALT-R/T)
Memory breakpoints were implemented in winuae/gbdserver by bartman, but I don't have a clear idea of how to visualize it in vscode... Maybe I must add a new view.

Conditional breakpoints would be great too, but it can be really challenging.
Reset emulator is an option of FS-UAE? This is a feature request to tonioni.
In vscode there is the restart button (green arrow).
prb28 is offline  
Old 23 November 2020, 09:30   #20
JoeJoe
Registered User
 
Join Date: Feb 2020
Location: Germany
Posts: 195
Quote:
Originally Posted by prb28 View Post
...Yes The mask parameter can be added to fsuae too. And it's already done in the version you have. Just add it to the launch parameters of fsuae...
Unfortunately I cannot confirm this. The debugger unfortunately does not stop. Tested with 0.20 version (mac+win)
JoeJoe is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Features requests for vscode amiga assembly extension ? prb28 Coders. General 0 27 December 2018 16:19
Benefactor Pre Release? BarryB support.Games 4 30 December 2011 23:56
Amiga OS4 Pre-Release: who's got it? Amiga1992 Amiga scene 45 03 October 2004 21:11
Twintris Pre-Release tomcat666 request.Old Rare Games 2 23 April 2004 11:34
p.OS Pre-Release ijelorriaga request.Apps 0 22 March 2002 22:51

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10115 seconds with 14 queries