BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
318 stars 40 forks source link

CloseWorkBench() is unable to close workbench screen #25

Closed sacredbanana closed 4 years ago

sacredbanana commented 4 years ago

Hi

I have an issue where the system call CloseWorkBench() fails. This call is used to close the main workbench screen. I do this to free up some memory. This normally only fails if some non drawer windows are open but none are. I assume something hidden is preventing the workbench screen to close?

BartmanAbyss commented 4 years ago

Hi, maybe this has something to do with the default shell window? The program being debugged is run from the startup-sequence without RUN, so probably it can't close the workbench screen because the CLI window is still open. Can you try modifying c:\Users\[YourUserName]\.vscode\extensions\bartmanabyss.amiga-debug-1.0.0\bin\dh0\s\startup-sequence and replace :runme.exe with run :runme.exe?

sacredbanana commented 4 years ago

image

BartmanAbyss commented 4 years ago

aha, so the amiga wiki lied ;) Get a Workbench 1.3 disk, make a new directory c:\Users\[YourUserName]\.vscode\extensions\bartmanabyss.amiga-debug-1.0.0\bin\dh0\c and copy RUN from the C directory on the WB disk there.

sacredbanana commented 4 years ago

OK I copied the run utility over (I was planning on trying that anyway) and now I get this: image

sacredbanana commented 4 years ago

I inserted a new line after that line and it gets rid of the y with 2 dots but its still the same unknown command

BartmanAbyss commented 4 years ago

hmm... strange... can you pack up a small repro case of your project? I'll take a look.

sacredbanana commented 4 years ago

Invite sent to my private repo

sacredbanana commented 4 years ago

If I remove the : to make it just run runme.exe it executes but still doesnt close the screen

BartmanAbyss commented 4 years ago

So, I found the correct startup-sequence by searching through old games, and found it in 'The Settlers':

run >nil: <nil: runme.exe >nil: <nil:
endcli >nil:

Copy the EndCLI command from the Workbench disk (same location as Run)

Also, for further information, check http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0576.html

I'll think about how I go on including that feature in future versions.

sacredbanana commented 4 years ago

No luck so far. I tried your solution and I get this:

image

BartmanAbyss commented 4 years ago

Hmm I tried the solution above and it did work for me. I'm not sure what's going wrong here...

sacredbanana commented 4 years ago

I thought nil: was always available as a system device

sacredbanana commented 4 years ago

Could it be a difference between the vscode marketplace version of the extension and what is on the latest commit?

BartmanAbyss commented 4 years ago

Yes, there's differences, however I don't think any of the changes affect this issue.

BartmanAbyss commented 4 years ago

I couldn't get it to work with the 1.0 release, so I added the new configuration parameter endcli to .vscode/launch.json. Get the latest preview and be sure to read the CHANGELOG (there have been some configuration changes), then in .vscode/launch.json, below the "program": ... line, add "endcli": true, and it should work!

sacredbanana commented 4 years ago

It worked! You sir are a hero

sacredbanana commented 4 years ago

Just tested on Kickstart 3.1.4 and the issue is present with this KS still. Probably affects KS > 2.0 ?