English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 19 August 2019, 22:04   #1
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Smile 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

Last edited by Bartman; 20 August 2019 at 11:23. Reason: added link with release
Bartman is offline  
Old 19 August 2019, 23:27   #2
MartinW
Registered User
 
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
[EDIT] Never mind - instructions are under the releases section of the GitHub repo
MartinW is offline  
Old 19 August 2019, 23:32   #3
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
Awesome, will try it ASAIC
kamelito is offline  
Old 20 August 2019, 01:30   #4
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
nice
Marlon_ is offline  
Old 20 August 2019, 12:06   #5
Steffest
Registered User
 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 189
Holly cow, that's awesome!
And better still: it even works! :-)

Thanks Bartman, that's a very VERY comfortable setup.
Steffest is offline  
Old 20 August 2019, 12:27   #6
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Wow, will try this out at home..

Thanks, Bartman.

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

Last edited by Tigerskunk; 20 August 2019 at 12:46.
Tigerskunk is offline  
Old 20 August 2019, 13:33   #7
MartinW
Registered User
 
Join Date: Mar 2017
Location: Minehead / UK
Posts: 608
Quote:
Originally Posted by Steril707 View Post
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.
MartinW is offline  
Old 20 August 2019, 14:28   #8
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
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 is offline  
Old 20 August 2019, 14:44   #9
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
updated the README with build command-lines
https://github.com/BartmanAbyss/vscode-amiga-debug
Bartman is offline  
Old 21 August 2019, 15:34   #10
jamie
Registered User
 
Join Date: Aug 2018
Location: canada
Posts: 6
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
jamie is offline  
Old 21 August 2019, 16:38   #11
prb28
Registered User
 
Join Date: May 2018
Location: France
Posts: 246
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 ?
prb28 is offline  
Old 21 August 2019, 22:28   #12
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by jamie View Post
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 is offline  
Old 21 August 2019, 22:29   #13
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by prb28 View Post
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...
Bartman is offline  
Old 22 August 2019, 08:29   #14
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
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?
deimos is offline  
Old 22 August 2019, 08:59   #15
Bastich
Registered User
 
Bastich's Avatar
 
Join Date: Jul 2011
Location: UK
Posts: 341
Now this is awesome. I must get round to trying this
Bastich is offline  
Old 22 August 2019, 09:05   #16
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
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.

Last edited by deimos; 22 August 2019 at 09:25.
deimos is offline  
Old 22 August 2019, 09:27   #17
KaiN
Registered User
 
Join Date: Sep 2018
Location: Poland
Posts: 15
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!
KaiN is offline  
Old 22 August 2019, 11:03   #18
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by deimos View Post
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 View Post
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 is offline  
Old 22 August 2019, 11:06   #19
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
Quote:
Originally Posted by KaiN View Post
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.
Bartman is offline  
Old 22 August 2019, 13:25   #20
KaiN
Registered User
 
Join Date: Sep 2018
Location: Poland
Posts: 15
Quote:
Originally Posted by Bartman View Post
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.
KaiN 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
Amiga Assembly extension for Visual Studio Code prb28 Coders. Asm / Hardware 342 15 December 2023 21:22
Visual Studio Code Blitz Basic extension earok Coders. Blitz Basic 29 16 July 2019 17:59
very basic C/ASM/Visual Studio hand holding Sephnroth Coders. C/C++ 2 08 March 2016 20:15
Profiling WinUAE with Visual Studio 2013 mark_k support.WinUAE 3 14 January 2014 20:26

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 01:31.

Top

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