English Amiga Board


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

 
 
Thread Tools
Old 05 April 2019, 08:13   #1121
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 393
Quote:
Originally Posted by meeku View Post
Hi, I've followed the guide to get eclipse/bgdbserver up and running.. It all worked up until trying to actually debug where I get an error from bgdbserver (on winUAE and echoed to Eclipse) saying:
failed to load program /test/hello-world;exit

Any ideas?
please check:
  • was hello-world copied into the folder '...../test'? (check post build command in Eclipse)
  • is bgdbserver located in the folder '...../test'?
  • was bgdbserver started with current dir '...../test'?
On the Amiga '/test/hello-world;exit' means: bgdbserver removes the trailing ';exit' and searches parent dir -> folder named 'test' -> program named 'hello-world'.
bebbo is offline  
Old 05 April 2019, 16:45   #1122
meeku
Registered User

 
Join Date: Apr 2019
Location: Kings Lynn
Posts: 13
Quote:
Originally Posted by bebbo View Post
please check:
  • was hello-world copied into the folder '...../test'? (check post build command in Eclipse)
  • is bgdbserver located in the folder '...../test'?
  • was bgdbserver started with current dir '...../test'?
On the Amiga '/test/hello-world;exit' means: bgdbserver removes the trailing ';exit' and searches parent dir -> folder named 'test' -> program named 'hello-world'.
Post build command in Eclipse is definitely copying the build output into /test on the Amiga. If I delete the file and re-build it's back where it should be.
bgdbserver is located in dh1:test
hello-world is located in dh1:test
bgdbserver is started in the /test folder with -r
The test folder is visible on both the PC and inside winuae
It all looks as it should!
meeku is offline  
Old 05 April 2019, 16:47   #1123
meeku
Registered User

 
Join Date: Apr 2019
Location: Kings Lynn
Posts: 13
I've also tried starting bgdbserver -r as
dh1:test/bgdbserver -r (using full path)
meeku is offline  
Old 30 April 2019, 14:19   #1124
jamie
Registered User
 
Join Date: Aug 2018
Location: canada
Posts: 6
Hello all,

I used one of the first version of gcc 6(thanks Bebbo) and i updated to the last version (installer 20190306), in my code i redefined the operator new and delete and now i have this error "multiple definition of `operator new(unsigned int); /Users/fmacr/AppData/Local/Temp/ccxeiJBZ.o:/Users/fmacr/AppData/Local/Temp/ccxeiJBZ.o.text+0x8464): first defined here"

Do you know how to fix this error? Thanks
jamie is offline  
Old 01 May 2019, 00:05   #1125
jamie
Registered User
 
Join Date: Aug 2018
Location: canada
Posts: 6
My mistake, my functions were in a .h but not inlined.
jamie is offline  
Old 02 May 2019, 23:18   #1126
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 39
Posts: 119
Send a message via ICQ to BastyCDGS
Regarding the low size startup code:

By using OldOpenLibrary instead of OpenLibrary for opening dos.library one moveq #33,d0 (i.e. 2 bytes more) is saved.

If we don't care about return code of OpenLib call, we actually can open any library version.
BastyCDGS is offline  
Old 04 May 2019, 18:00   #1127
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,014
I am probably missing something obvious but I can't get attached program (source + binary included) to run under KS 1.3. (It runs fine if KS 2.0+). Or am I expecting something that is not yet implemented?

Something in startup code tries to execute JSR (A6,-$02ac) = AllocVec, before main() gets called.

This program needs to run under KS 1.3 + 68000 for obvious reasons (loads A500 UAE state files. "Official" release will happen when it runs under KS 1.3, don't ask anything yet..)

I usually write these kinds of programs in assembly but this time I tried to write almost everything in C and only small critical bits in assembly.

Last edited by Toni Wilen; 04 May 2019 at 19:21.
Toni Wilen is offline  
Old 04 May 2019, 18:22   #1128
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 393
Quote:
Originally Posted by Toni Wilen View Post
I am probably missing something obvious but I can't get attached program (source + binary included) to run under KS 1.3. (It runs fine if KS 2.0+). Or am I expecting something that is not yet implemented?

Something in startup code tries to execute JSR (A6,-$02ac) = AllocVec, before main() gets called.
Guess you got caught by a recent bug: I killed somehow the "-mcrt=nix13" flag for nix13 builds, so the AllocVec replacement was neither built nor used.

But it's fixed already.

update, rinse and repeat?

I'll look into it too.
bebbo is offline  
Old 04 May 2019, 18:26   #1129
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 491
Quote:
Originally Posted by Toni Wilen View Post
I am probably missing something obvious but I can't get attached program (source + binary included) to run under KS 1.3. (It runs fine if KS 2.0+). Or am I expecting something that is not yet implemented?

Something in startup code tries to execute JSR (A6,-$02ac) = AllocVec, before main() gets called.

This program needs to run under KS 1.3 + 68000 for obvious reasons (loads A500 UAE state files. "Official" release will happen when it runs under KS 1.3, don't ask anything yet..)

I usually write these kinds of programs in assembly but this time I tried to write almost everything in C and only small critical bits in assembly.
¨
Your toolchain needs update. With a version git-pulled/make update/make on 2/5, I get a running executable on (emulated) A1000.

Displays "Statefile parameter missing." when run.
alkis is offline  
Old 04 May 2019, 19:20   #1130
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,014
Thanks. I knew I missed something obvious, it works now. I did update few days ago but didn't notice there was even more recent changes.
Toni Wilen is offline  
Old 05 May 2019, 05:29   #1131
ShK
Registered User
ShK's Avatar
 
Join Date: Mar 2013
Location: Lahti / Finland
Age: 48
Posts: 350
Does this compile for you with -lnix13 LIBS?

https://github.com/tonioni/pfsdoctor
ShK is offline  
Old 05 May 2019, 10:42   #1132
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 393
Quote:
Originally Posted by ShK View Post
Does this compile for you with -lnix13 LIBS?

https://github.com/tonioni/pfsdoctor
no - it needs asl.library
bebbo is offline  
Old 06 May 2019, 13:19   #1133
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 548
Bebbo, prebuilt windows toolchain not updated anymore ?

EDIT: Updated, thanks

Last edited by arti; 07 May 2019 at 12:34.
arti is offline  
Old 07 May 2019, 20:11   #1134
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,014
ndk13-include/inline/expansion.h has only one function (AddConfigDev). Manual copy from ndk-include worked as a workaround (I needed FindConfigDev which exists in KS 1.3).
Toni Wilen is offline  
Old 31 May 2019, 16:04   #1135
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,040
@bebbo
im trying to get scalos compile with your gcc, but a type is missing from stdlib header, as it seems:
Code:
/home/wawa/opt/amiga/m68k-amigaos/sys-include/stdlib.h:108:64: error: unknown type name '_mbstate_t'
__stdargs int _mblen_r (struct _reent *, const char* , size_t, _mbstate_t *);
wawa is offline  
Old 31 May 2019, 20:45   #1136
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 491
grep -R _mbstate_t /opt/amiga/ (or wherever you installed the compiler) shows up a few places.

wchar.h looks most promising. Maybe try #include <wchar.h> prior to stdlib.h?
alkis is offline  
Old 31 May 2019, 20:57   #1137
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,014
How is it possible to have 68020, 68030 and 68040/060 specific instructions in same assembly file?

https://github.com/tonioni/ussload/blob/master/asm.S and uncomment PMOVEs at the end. How to compile this without ugly dc.w <opcode> workarounds?

For example "MOVEC D0,CAAR" is 68020/68030 only, "PMOVE (SP),TC" is 68030 only and "MOVEC D0,URP" is 68040/060 only.

(Thanks for fixing ndk1.3 expansion.library )
Toni Wilen is offline  
Old 31 May 2019, 21:08   #1138
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 142
there’s the ‚mc680x0‘ directive. Would it be possible to sprinkle multiple of them into the right places?
pipper is offline  
Old 01 June 2019, 18:38   #1139
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 393
Quote:
Originally Posted by Toni Wilen View Post
How is it possible to have 68020, 68030 and 68040/060 specific instructions in same assembly file?

https://github.com/tonioni/ussload/blob/master/asm.S and uncomment PMOVEs at the end. How to compile this without ugly dc.w <opcode> workarounds?

For example "MOVEC D0,CAAR" is 68020/68030 only, "PMOVE (SP),TC" is 68030 only and "MOVEC D0,URP" is 68040/060 only.

(Thanks for fixing ndk1.3 expansion.library )

I modified the .arch directive locally in m68k-amigaos-as to be used multiple times... so this would work:



Code:
        | switch to 68040
        .arch 68040
        movec d0,urp
        .arch   68020
        movec d0,caar
        .arch 68030
        pmove (sp),tc
        .arch 68000
        | back to 68000

and really yields:
Code:
   0:   4e7b 0806       movec d0,urp
   4:   4e7b 0802       movec d0,caar
   8:   f017 4000       pmove (sp),tc


If you want it, I'll put it live.
bebbo is offline  
Old 01 June 2019, 18:43   #1140
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 393
Quote:
Originally Posted by wawa View Post
@bebbo
im trying to get scalos compile with your gcc, but a type is missing from stdlib header, as it seems:
Code:
/home/wawa/opt/amiga/m68k-amigaos/sys-include/stdlib.h:108:64: error: unknown type name '_mbstate_t'
__stdargs int _mblen_r (struct _reent *, const char* , size_t, _mbstate_t *);

_mbstate_t was a pita (and maybe is) but for some time there were no more problems with it.


Please provide a proper example - mini source plus Makefile or provide at least your command line options.
bebbo 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
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45

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 03:16.


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