English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. C/C++ (http://eab.abime.net/forumdisplay.php?f=118)
-   -   Amiga GCC 8.3+gdb extension for Visual Studio Code (http://eab.abime.net/showthread.php?t=98525)

Bartman 19 August 2019 23:04

Amiga GCC 8.3+gdb extension for Visual Studio Code
 
I made an open-source VS Code extension for Amiga 500 demo development. Repo on GitHub

One-stop Visual Code Extention to compile and debug Amiga C programs compiled by included gcc 8.3.0 in WinUAE.

Features
  • No additional tools required. Everything is included (except Kickstart ROM ?). Ready to go make your next Amiga 500 production!
  • State-of-the-art code generation by GCC with Link-Time-Optimizations (LTO) for increased performance and smaller code size
  • IntelliSense
  • Full source-level and assembly-level debugging with callstack, breakpoints, watches, registers, memory view with GDB-enabled WinUAE
  • Fully AmigaOS compatible via included .h files
  • INCBIN support
  • Output to debug console from WinUAE
  • WinUAE warp-launch (turbo-boot)
  • WinUAE warp-mode control from your Amiga project

Have a look at My Seminar 'Modern Amiga 500 Demo Development' at Evoke 2019 for more information about this and behind-the-scenes of our 64k intro CODA.

I'm here for any questions, just wanted to get the first release out there.

First release with install instructions

MartinW 20 August 2019 00:27

[EDIT] Never mind - instructions are under the releases section of the GitHub repo

kamelito 20 August 2019 00:32

Awesome, will try it ASAIC

Marlon_ 20 August 2019 02:30

nice :)

Steffest 20 August 2019 13:06

Holly cow, that's awesome!
And better still: it even works! :-)

Thanks Bartman, that's a very VERY comfortable setup.

Steril707 20 August 2019 13:27

Wow, will try this out at home..

Thanks, Bartman.

edit: it's only working on windows... damn it... ;)

MartinW 20 August 2019 14:33

Quote:

Originally Posted by Steril707 (Post 1340131)
edit: it's only working on windows... damn it... ;)

My thoughts too! Fortunately I have access to Windows, Linux and Mac but I wish it were available for Mac (preferably) or Linux with FS-UAE. I guess someone needs to take care of the GCC 8 port first though.

I couldn't get the breakpoint to hit when using my own code. Actually some sample code from Novacoder but I'm probably doing something dumb so I'll have another go tonight by attempting to put some of my own code into the example and see if that hits breakpoints.

Bartman 20 August 2019 15:28

Getting GCC and GDB working on Linux should be very easy, as GCC only has like 4 lines of modifications, and GDB about 10 lines. I'll be posting my compilation flags in a bit. Porting the GDB-Server from WinUAE to FS-UAE is probably a bit more work, but could be done. So if someone's up to the task...
emoon started a GDB-Server for FS-UAE a while ago... https://github.com/emoon/fs-uae

Bartman 20 August 2019 15:44

updated the README with build command-lines
https://github.com/BartmanAbyss/vscode-amiga-debug

jamie 21 August 2019 16:34

Hello Bartman, why is it only C and not c++ too? Btw congratulation for the hard work, it's really impressive and now my tool chain with gcc 6.2 and vs2017 seems really old:)

prb28 21 August 2019 17:38

Nice work!
Your gdb integration is much more generic than mine on the amiga assembly extension.
Does it work with a mix of assembly and C sources in step debug ?

Bartman 21 August 2019 23:28

Quote:

Originally Posted by jamie (Post 1340417)
Hello Bartman, why is it only C and not c++ too? Btw congratulation for the hard work, it's really impressive and now my tool chain with gcc 6.2 and vs2017 seems really old:)

That's just because Pink didn't want C++. g++ could be built using just an additional command-line flag, but getting the whole stdlib/runtime working would probably be a bit more work.
The current version doesn't have any stdlib/default lib...

Bartman 21 August 2019 23:29

Quote:

Originally Posted by prb28 (Post 1340429)
Nice work!
Your gdb integration is much more generic than mine on the amiga assembly extension.
Does it work with a mix of assembly and C sources in step debug ?

I guess so. Yeah, the gdb-server needed to work with a real GDB, so no faking around. Just had to patch a few lines in GDB...

deimos 22 August 2019 09:29

This is awesome. Up till now I've been happy with VBCC cross compiling from Windows, but always missed having a full debugger.

Is there any chance that the gdb-server integration might become a standard part of WinUAE?

Bastich 22 August 2019 09:59

Now this is awesome. I must get round to trying this :)

deimos 22 August 2019 10:05

I'm getting the following when trying to init an amiga project:

Error: the description can't be converted into a problem matcher:
{
"base": "$gcc",
"fileLocation": "absolute"
}


Any ideas?

EDIT:

Also, something doesn't like spaces in directory names:

m68k-amiga-elf-gcc: fatal error: no input files
compilation terminated.
m68k-amiga-elf-gcc: error: C:/Users/Deimos/Desktop/Amiga: No such file or directory
m68k-amiga-elf-gcc: error: Development/test/main.c: No such file or directory
m68k-amiga-elf-gcc: fatal error: no input files


That's one folder, "C:/Users/Deimos/Desktop/Amiga Development/test/main.c"

EDIT 2:

Removing the space in the folder name and starting over, it works, I can compile, run and debug the example, setting a break point, etc., but I still get the problem matcher error in the output tab.

KaiN 22 August 2019 10:27

Amazing!

I'm using vscode on a daily basis not only for Amiga but also for my work, hence I have a small suggestion. Would it be possible to split that entire package into:

- vscode extension available from vscode marketplace - this way we get auto updates from you
- gcc / other executables - this way download size is smaller and would allow later portability by providing variants of only this package
- ability to specify already installed WinUAE - from what I read you bundle one, but I have one already neatly set up in my OS

This way I could have gcc 8.3 compiler in my "compilers" directory and perhaps one could also attach bebbo's compiler (for performance comparison) into your extension via settings.json or something. I know debugging probably won't work that way and I won't even encourage you to support it, but building would. Also, perhaps in some kind of future (I hope near one) we could attach LLVM-based toolchain, if any m68k target gets completed for it.

Also, I haven't really launched it yet since I'm at work, but I wonder if it collides with other build systems. I tend to have my projects CMake-based. Perhaps this extension can be chained together with CMake extension?

Overall, this is a very nice extension and I appreciate your effort! Please don't take my suggestions offensively, as I just want to help in making it more versatile. ;)

Also, Amiga debugging in vscode. What a treat! You're the best! ;)

Bartman 22 August 2019 12:03

Quote:

Originally Posted by deimos (Post 1340602)
I'm getting the following when trying to init an amiga project:

Error: the description can't be converted into a problem matcher:
{
"base": "$gcc",
"fileLocation": "absolute"
}


Any ideas?

Hmm, haven't heard that one before. Have you tried installing the C/C++ extension?

Quote:

Originally Posted by deimos (Post 1340602)
Also, something doesn't like spaces in directory names:

Ah yes, the dreaded spaces. Couldn't find a fix for it. IIRC gnumake doesn't like the spaces, not even when quoted.

Bartman 22 August 2019 12:06

Quote:

Originally Posted by KaiN (Post 1340605)
Amazing!

I'm using vscode on a daily basis not only for Amiga but also for my work, hence I have a small suggestion. Would it be possible to split that entire package into:

- vscode extension available from vscode marketplace - this way we get auto updates from you
- gcc / other executables - this way download size is smaller and would allow later portability by providing variants of only this package
- ability to specify already installed WinUAE - from what I read you bundle one, but I have one already neatly set up in my OS

It really needs to be bundled together, as I modified WinUAE aswell.
You can't replace the gcc with bebbo's, because his outputs Amiga Hunk files directly whereas mine just outputs ELF files that are converted with elf2hunk, and GDB requires ELF files as well.
I may be uploading the extension to the marketplace when I have time.

KaiN 22 August 2019 14:25

Quote:

Originally Posted by Bartman (Post 1340620)
It really needs to be bundled together, as I modified WinUAE aswell.
You can't replace the gcc with bebbo's, because his outputs Amiga Hunk files directly whereas mine just outputs ELF files that are converted with elf2hunk, and GDB requires ELF files as well.
I may be uploading the extension to the marketplace when I have time.

So I guess we'd need a bigger coordination to make it more modular. Perhaps WinUAE changes could be incorporated into official future releases. They don't look like breaking some kind of functionality, perhaps some ifs are missing so that old/your code gets enabled based on config, but I see only improvement here.

It's of course a long term plan. I hope Toni Wilen gets interested in merging your changes as it would guarantee getting latest UAE version without needing to rebase your changes on top of latest sources.


All times are GMT +2. The time now is 16:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.

Page generated in 0.07299 seconds with 11 queries