English Amiga Board


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

 
 
Thread Tools
Old 02 January 2019, 02:48   #981
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
Quote:
Originally Posted by _dante_ View Post
Regarding the "awk: ... makes too many open files" - maybe usage of 'gawk' installed using 'brew' is getting rid of these errors, as I have it installed to override Apple's awk and I didn't get that error while building libnix.
macOS awk is well known for not being 100% compatible with gawk.
Hewitson is offline  
Old 02 January 2019, 15:58   #982
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Hewitson View Post
macOS awk is well known for not being 100% compatible with gawk.
macOS is well known to be a crappy wanker operating system.

SCNR
bebbo is offline  
Old 02 January 2019, 16:58   #983
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
I used Linux & BSD for years. Their package management systems suck and none of the window managers ever appealed to me. In fact I stuck with twm for many years just to avoid the bloatware.

macOS is fast, reliable, and honestly, an absolute pleasure to use. A fantastic OS.
Hewitson is offline  
Old 02 January 2019, 17:53   #984
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Quote:
Originally Posted by bebbo View Post
your toolchain does not support the amiga hunk format.
Too bad, I try to compile it in elf but it's plain stupid.

/mnt/e/usr/local/amiga/m68k-amigaos/clib/cross/bin/../lib/gcc/m68k-unknown-amigaos/3.4.6/../../../../m68k-unknown-amigaos/include/stdlib.h:43:25: 
no include path in which to search for stdlib.h


Why it needs another stdlib.h ...

WTF?!
arti is offline  
Old 02 January 2019, 18:03   #985
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Why don’t you use gcc6? What is the reason for still using gcc3?
Marlon_ is offline  
Old 02 January 2019, 18:12   #986
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
It just doesn't work for most stuff I tried.

It'a a great effort and I hope it to be usable one day.
arti is offline  
Old 02 January 2019, 18:15   #987
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
The GCC 3 parser is loose enough to drive a train through and GCC 6 isn't, in other words.
Samurai_Crow is offline  
Old 02 January 2019, 18:18   #988
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by Samurai_Crow View Post
The GCC 3 parser is loose enough to drive a train through and GCC 6 isn't, in other words.

the gcc6 toolchain is more than usable.
Marlon_ is offline  
Old 02 January 2019, 18:27   #989
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Try a big c++ project.
arti is offline  
Old 02 January 2019, 18:28   #990
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by arti View Post
Try a big c++ project.


I have
Marlon_ is offline  
Old 02 January 2019, 18:39   #991
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Can you go to #ap...-co.e ?
arti is offline  
Old 02 January 2019, 19:07   #992
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by arti View Post
Can you go to #ap...-co.e ?


Not by a computer, I’ll let you know when I’m available
Marlon_ is offline  
Old 02 January 2019, 23:59   #993
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by arti View Post
Can you go to #ap...-co.e ?
I googled that without useful result...
... please use ecplicit lyrics!


And to keep the community happy/tormale/whatever, I have created a tutorial for Eclipse as an IDE for programming and debugging Amiga applications.

https://franke.ms/amiga/gdb-eclipse.wiki
bebbo is offline  
Old 04 January 2019, 12:36   #994
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
How can I fix this ?

/amiga-gcc/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: different object file formats composing set ___CTOR_LIST__
/amiga-gcc/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: different object file formats composing set ___DTOR_LIST__
arti is offline  
Old 04 January 2019, 13:09   #995
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Sounds like the constructors and destructors aren't compiled to the same object code format. A clean rebuild of all .o and .a files is in order by the sound of it.
Samurai_Crow is offline  
Old 04 January 2019, 13:27   #996
arti
Registered User
 
Join Date: Jul 2008
Location: Poland
Posts: 662
Didn't help.
arti is offline  
Old 04 January 2019, 14:52   #997
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by arti View Post
How can I fix this ?

/amiga-gcc/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: different object file formats composing set ___CTOR_LIST__
/amiga-gcc/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: different object file formats composing set ___DTOR_LIST__
could you provide more info please?
Maybe share the project somehow??
bebbo is offline  
Old 04 January 2019, 19:07   #998
_dante_
Registered User
 
Join Date: Feb 2018
Location: Poland
Posts: 12
It looks that I found unwanted compiler optimization - when it comes to debugging...

I have a simple hello.c code:
Code:
#include <stdio.h>

int main(int argc, char **argv) {
        puts("hello world!");
        printf("argc=%ld\r\n", argc);
        for (int i = 0; i < argc; ++i) {
                char *t = argv[i];
                printf("arg=%s\r\n", t);
        }
        return 0;
}
I built debuggable executable using simple command without optimizations or other fancy flags.
Code:
m68k-amigaos-gcc hello.c -g -noixemul -o hello-noixemul
Then I run it on FS-UAE using bgdbserver 0.5... and started debugging...


Below is the console snapshot from the same point in time as on the above FS-UAE screenshot. I bolded sections I would ask for.
Code:
$ m68k-amigaos-gdb hello-noixemul
GNU gdb (GDB) 8.2.50.20181223-111052-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin18.2.0 --target=m68k-amigaos".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello-noixemul...done.
(gdb) target remote :2345
Remote debugging using :2345
warning: Target reported unsupported offsets: Text=680246d8;Data=68018d78;Bss=68017a88;
warning: Target reported unsupported offsets: Text=680246d8;Data=68018d78;Bss=68017a88;
0x680246d8 in _stext ()
(gdb) list
1	#include <stdio.h>
2	
3	int main(int argc, char **argv) {
4	        puts("hello world!");
5	        printf("argc=%ld\r\n", argc);
6	        for (int i = 0; i < argc; ++i) {
7	                char *t = argv[i];
8	                printf("arg=%s\r\n", t);
9	        }
10	        return 0;
(gdb) b 8
Breakpoint 1 at 0x680247fe: file hello.c, line 8.
(gdb) c
Continuing.

Breakpoint 1, main (argc=7, argv=0x680186b4) at hello.c:8
8	                printf("arg=%s\r\n", t);
(gdb) c
Continuing.

Breakpoint 1, main (argc=7, argv=0x680186b4) at hello.c:8
8	                printf("arg=%s\r\n", t);
(gdb) c
Continuing.

Breakpoint 1, main (argc=7, argv=0x680186b4) at hello.c:8
8	                printf("arg=%s\r\n", t);
(gdb) c
Continuing.

Breakpoint 1, main (argc=7, argv=0x680186b4) at hello.c:8
8	                printf("arg=%s\r\n", t);
(gdb) info local
i = 3
(gdb) p argv[i]
$1 = 0x68018691 "ccc"
(gdb) p t
No symbol "t" in current context.
(gdb) 
1. What does these warnings mean? Why 'unsupported offsets'? Is that okay that these offsets are in fact hunk offsets presented by bgdbserver but additionally shifted by 4 bytes?

2. Symbol "t" is declared and assigned at line 7, then used at line 8, but gdb does not show it as a valid symbol in this context (info local, p t at the end of console snapshot) - p i of course works in this context too. The result printed out to the screen is correct so there must be some kind of optimization in this place like 'putting t symbol into address register' - but why if I didn't compile sources with any of the -O flags?
_dante_ is offline  
Old 04 January 2019, 20:12   #999
hth313
Registered User
 
hth313's Avatar
 
Join Date: May 2018
Location: Delta, Canada
Posts: 192
I cannot answer all your questions, but the reason there is no symbol "t" I can at least speculate on.

Symbol "t" is only use as a temporary once and the compiler may decide to just rewrite the call to
printf("arg=%s\r\n", [argv[i]);
and eliminate the variable. It may decide to perform certain rewrites no matter if you enabled optimization or not. (I am not going to argue whether that is desirable or not, just that such is life.)

There may be some option to advice the compiler to produce more debuggable output, I do not know.

Even if the compiler does such rewrites, the debug information (DWARF) can express that the variable exists and have a given value, also when it does not correspond to any actual physical location of its own. I suppose that this is not implemented or done here.
hth313 is offline  
Old 04 January 2019, 21:39   #1000
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by _dante_ View Post
It looks that I found unwanted compiler optimization - when it comes to debugging...

1.
...
(gdb) target remote :2345
Remote debugging using :2345
warning: Target reported unsupported offsets: Text=680246d8;Data=68018d78;Bss=68017a88;
warning: Target reported unsupported offsets: Text=680246d8;Data=68018d78;Bss=68017a88;
0x680246d8 in _stext ()



2. Symbol "t" is declared and assigned at line 7, then used at line 8, but gdb does not show it as a valid symbol in this context (info local, p t at the end of console snapshot) - p i of course works in this context too. The result printed out to the screen is correct so there must be some kind of optimization in this place like 'putting t symbol into address register' - but why if I didn't compile sources with any of the -O flags?
1. in modern systems there is always one linear address space for the program. The Amiga is different.
It's just an information and don't plan to remove that warnings.

2. no idea guess hth313 is right here and it's too simple that even without optimizer that variable is discarded.
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 05:59.

Top

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