English Amiga Board


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

 
 
Thread Tools
Old 18 November 2019, 09:58   #41
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by Tom_Goblins View Post
I am using Bebbo's GCC using c++ and it works great for me (Thanks Bebbo! ).

Woot! Someone is using it





Quote:
Originally Posted by Tom_Goblins View Post
...

but as an Amiga program when I disable system, the server running on the amiga goes away too (maybe I am missing something here?).
...

Since bgdbserver uses a TCP connection Forbid() will kill this too.


But Forbid() usage should be rare - maybe you could use a semaphore instead?
bebbo is offline  
Old 19 November 2019, 02:29   #42
Tom_Goblins
Registered User

 
Join Date: Dec 2018
Location: Seattle
Posts: 6
Thanks for the reply Bebbo.

I will need to double check, I am not using forbid() specifically that I know. I use some startup code from loonies, my guess is that is disabling interrupts and dma to kill the system, that disables the gdbserver, I will check that.

I saw that those integrations on *UAE with gdb and sounds great but they "hate" c++ or I dont know how to make it work.

some questions for you then?

Would be possible to adapt your gdbserver to be part of a modified version of FS-UAE or WinUAE so it could be at the emulator level?

Have you tried connecting from VSCode using the GDB, I think I got it working once, but not sure if it is meant to work with it.

Not sure if I am crazy, trying to do my stuff in modern c++, as I can see most of people just avoid it in favor of plain C XD?
Tom_Goblins is offline  
Old 19 November 2019, 10:53   #43
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by Tom_Goblins View Post
Thanks for the reply Bebbo.

I will need to double check, I am not using forbid() specifically that I know. I use some startup code from loonies, my guess is that is disabling interrupts and dma to kill the system, that disables the gdbserver, I will check that.

I saw that those integrations on *UAE with gdb and sounds great but they "hate" c++ or I dont know how to make it work.

some questions for you then?

Would be possible to adapt your gdbserver to be part of a modified version of FS-UAE or WinUAE so it could be at the emulator level?

Have you tried connecting from VSCode using the GDB, I think I got it working once, but not sure if it is meant to work with it.

Not sure if I am crazy, trying to do my stuff in modern c++, as I can see most of people just avoid it in favor of plain C XD?

Q1: I guess there is a WinUAE version containing a gdb server. I have no clue if my code would be helpful there.



Q2: I never tried it. I'm using Eclipse - it's working despite it needs a hack for the Amiga.


I'm using the libnix library if I code something for the Amiga also with c++. You can create programs with a reasonable size even using c++. But it's easy to blow the code size up^^



Plus I also debug my real Amiga over TCP.
bebbo is offline  
Old 19 November 2019, 19:02   #44
Tom_Goblins
Registered User

 
Join Date: Dec 2018
Location: Seattle
Posts: 6
I am happy with the current setup on c++ but I am missing a good way to debug. I just go around with old school debugging but it is not great.

Code size goes nuts as you use c++ libs, so I have pretty minimal usage of them, to keep executable size manageable. For debugging I can get a 800K exe .

I will keep advancing my project with c++ but I can always fall back to plain C if I find some obstacles moving forward.
Tom_Goblins is offline  
Old 20 November 2019, 10:35   #45
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by Tom_Goblins View Post
Code size goes nuts as you use c++ libs, so I have pretty minimal usage of them, to keep executable size manageable. For debugging I can get a 800K exe .

for 'smaller' c++:


- don't use std::streams
- use -fno-exceptions -fno-rtti - unless you are really using excpetions/rtti
- use -flto
- move non-inlineable member functions into a corresponding cpp file
- use base classes - even for templates - with common code in cpp files
- don't use codesize increasing c++ features because these exist or you think it's cool... - but use these if it's a real benefit
bebbo is offline  
Old 20 November 2019, 20:01   #46
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,352
Quote:
Originally Posted by Tom_Goblins View Post
Would be possible to adapt your gdbserver to be part of a modified version of FS-UAE or WinUAE so it could be at the emulator level?
I was originally against doing this because I don't really like GDB (for example disassembly syntax is simply horrible..) but now that there are better options than basic GDB so perhaps this is good idea after all..
Toni Wilen is offline  
Old 20 November 2019, 21:47   #47
Tom_Goblins
Registered User

 
Join Date: Dec 2018
Location: Seattle
Posts: 6
Quote:
Originally Posted by bebbo View Post
for 'smaller' c++:


- don't use std::streams
- use -fno-exceptions -fno-rtti - unless you are really using excpetions/rtti
- use -flto
- move non-inlineable member functions into a corresponding cpp file
- use base classes - even for templates - with common code in cpp files
- don't use codesize increasing c++ features because these exist or you think it's cool... - but use these if it's a real benefit

Thanks for the tips, basically I am using some of them, my debug exe is huge, but release is under 50K, which I can do better but good enough to keep going.

I use c++ but close to simple C to avoid that library explosion. but as today, I don't see much benefits on doing the project on plain C. C++ has a bad reputation, in part I think for people getting lost on complex and obscure language constructions. But c++ can be as plain and simple as C in IMHO.
Tom_Goblins is offline  
Old 20 November 2019, 21:55   #48
Tom_Goblins
Registered User

 
Join Date: Dec 2018
Location: Seattle
Posts: 6
Quote:
Originally Posted by Toni Wilen View Post
I was originally against doing this because I don't really like GDB (for example disassembly syntax is simply horrible..) but now that there are better options than basic GDB so perhaps this is good idea after all..
I am not a great fan of GDB myself either, but after seeing some of these integrations on VSCode and other debuggers. I think having that integrated at the emulator level is awesome.

That being said, I want to thank you a lot for your work on WinUAE. It is probably the one big reason why I came back to Amiga and me and my group we are still doing productions for it. I have also a Mist (FPGA) but I use WinUAE all the time.
Tom_Goblins is offline  
Old 20 November 2019, 22:33   #49
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 3,303
A gdb server integrated in WinUAE would be awesome! My C++ game is OS friendly to a point so I don't care.

But it also opens new perspectives: for instance I think that a WinUAE-based server could catch illegal instructions, misaligned addresses, illegal writes, …, or some GURUs, allowing to see the stacktrace of the faulty code. Today, the whole thing goes guru.

Also watchpoints would be possible at source level (since WinUAE asm debugger already has watchpoints). But we're probably talking of too much work.
jotd 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
Csound 3.481 on m68k squidbass Amiga scene 5 21 July 2013 22:29
Rewriting m68k code RobSis Coders. Tutorials 1 26 January 2013 17:15
Remote GDB debugging copse support.WinUAE 6 31 August 2011 02:05
m68k-amigaos-ld.exe bug ? FrenchShark Coders. General 2 30 November 2009 10:54
Shorten ported to AmigaOS m68k and WarpOS Paul News 0 20 August 2006 13:05

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 07:59.


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