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)

Spec-Chum 04 November 2019 15:20

Quote:

Originally Posted by deimos (Post 1356484)
I've not touched anything yet, so my makefile looks like:

Code:

CCFLAGS = -g -MP -MMD -m68000 -O1 -nostdlib -Wall -Wno-pointer-sign -Wno-unused-function -Wno-volatile-register-var -Wno-discarded-qualifiers -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program
I will try to change that and hopefully reproduce your problem.

EDIT:

Yes, problem confirmed with the default of:

Code:

CCFLAGS = -g -MP -MMD -m68000 -Ofast -nostdlib -Wall -Wno-pointer-sign -Wno-unused-function -Wno-volatile-register-var -Wno-discarded-qualifiers -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program
The sprite doesn't move.

Thanks for confirming, can you just put volatile on the spr[1]++ cast at all?

I'm at work, so can't check :(

deimos 04 November 2019 15:21

And it looks like your diagnosis is correct:

Code:

((/* important */ volatile /* here */ UBYTE *)spr)[1]++;

Spec-Chum 04 November 2019 15:31

Quote:

Originally Posted by deimos (Post 1356490)
And it looks like your diagnosis is correct:

Code:

((/* important */ volatile /* here */ UBYTE *)spr)[1]++;

Awesome, thanks for checking :)

Spec-Chum 04 November 2019 20:40

Quote:

Originally Posted by deimos (Post 1356490)
And it looks like your diagnosis is correct:

Code:

((/* important */ volatile /* here */ UBYTE *)spr)[1]++;

Home now, confirmed working again with -Ofast, hooray! :spin

Thanks again for checking, much appreciated!

Tom_Goblins 19 November 2019 05:01

Please can you confirm if it works for c++?, I saw a comment before but It wasn't clear enough.

I am trying to find my environment to code on c++ but now I am missing a nice debugger and this could be a great solution. I have been using Bebbo's gdbserver, printf!!, tons of them XD.

Thanks!

asymetrix 02 December 2019 16:25

I got the addon to work but could not figure out how to include standard C/C++ headers - I could not follow an Amiga C book nor a standard windows C book.
Amiga really hinders my programming experience.

deimos 02 December 2019 22:05

Quote:

Originally Posted by asymetrix (Post 1362678)
I got the addon to work but could not figure out how to include standard C/C++ headers - I could not follow an Amiga C book nor a standard windows C book.

That's not what it's for. It's not a full C++ environment with all those libraries. It's a cut down pure Amiga environment for demo / game creators.

roondar 09 December 2019 22:54

I've recently found this rather useful extension. It works well, but I have run into a small problem.

Debugging only seems to work once.

That is, I can debug to my hearts content, until I stop debugging. When I use the Stop Debugging command from VS Code (prior to the program itself ending), this does stop the debugger. But after that I can't get it to start again. I have to restart Visual Studio Code for it to work once more.

Does anyone here know how to fix this?

thyslo 18 January 2020 13:49

For debugging I'm building the object files like

Code:

/opt/amiga/bin/m68k-amigaos-c++ -fno-rtti -fno-exceptions -noixemul -O0 -g -Wl,--amiga-debug-hunk -ldebug -c -o file.o file.cpp
Then I link them all using the silimar call

Code:

/opt/amiga/bin/m68k-amigaos-c++ -fno-rtti -fno-exceptions -noixemul -O0 -g -Wl,--amiga-debug-hunk -ldebug -o Application *.o
When debugging the stepping through the code works. But all variables are displayed with wrong / random values. These values don't change when stepping over a line where such a variable is set.

Is there something obviously wrong with my gcc/c++ options?


All times are GMT +2. The time now is 18:00.

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

Page generated in 0.04740 seconds with 11 queries