The output below from objdump suggests that stabs debugging info from gpc is broken. Does this happen on other platforms also ?
Regards,
Adriaan van Os
-------
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c hello.pas -g [G4:~/gnu/testgpc/adriaan] adriaan% objdump -g hello.o
hello.o: file format mach-o-be
Bad stab: Datevalid:(0,5)=@s8;- 16;,0,1;Timevalid:(0,5),1,1;Year:(0,1),2,32;Month:(0,6)=r(0,1);1;12;,34, 4;Day:(0,7)=r(0,1);1;31;,38,5;Dayofweek:(0,8)=r(0,1);0;6;,43,3;Hour:(0,9 )=r(0,1);0;23;,46,5;Minute:(0,10)=r(0,1);0;59;,51,6;Second:(0,11)=r(0,1) ;0;61;,57,6;Microsecond:(0,12)=r(0,1);0;999999;,63,20;Timezone:(0,1),83, 32;Dst:(0,5),115,1;Tzname1:(0,13)=s44Capacity:(0,14)=r(0,14);00000000000 00;0037777777777;,0,32;length:(0,14),32,32;_p_Schema_:(0,15)=ar(0,1);1;3 3;(0,2),64,264;;,128,352;Tzname2:(0,16)=s44Capacity:(0,14),0,32;length:( 0,14),32,32;_p_Schema_:(0,17)=ar(0,1);1;33;(0,2),64,264;;,480,352;; Last stabs entries before error: n_type n_desc n_value string SO 0 0000000000000000 /Users/adriaan/gnu/testgpc/adriaan/ SO 0 0000000000000000 hello.pas OPT 0 0000000000000000 gcc2_compiled. LSYM 0 0000000000000000 integer:t(0,1)=r(0,1);-2147483648;2147483647; LSYM 0 0000000000000000 char:t(0,2)=@s8;-20; LSYM 0 0000000000000000 Complex:t(0,3)=R4;16;0; LSYM 0 0000000000000000 Timestamp:t(0,4)=s104Datevalid:(0,5)=@s8;- 16;,0,1;Timevalid:(0,5),1,1;Year:(0,1),2,32;Month:(0,6)=r(0,1);1;12;,34, 4;Day:(0,7)=r(0,1);1;31;,38,5;Dayofweek:(0,8)=r(0,1);0;6;,43,3;Hour:(0,9 )=r(0,1);0;23;,46,5;Minute:(0,10)=r(0,1);0;59;,51,6;Second:(0,11)=r(0,1) ;0;61;,57,6;Microsecond:(0,12)=r(0,1);0;999999;,63,20;Timezone:(0,1),83, 32;Dst:(0,5),115,1;Tzname1:(0,13)=s44Capacity:(0,14)=r(0,14);00000000000 00;0037777777777;,0,32;length:(0,14),32,32;_p_Schema_:(0,15)=ar(0,1);1;3 3;(0,2),64,264;;,128,352;Tzname2:(0,16)=s44Capacity:(0,14),0,32;length:( 0,14),32,32;_p_Schema_:(0,17)=ar(0,1);1;33;(0,2),64,264;;,480,352;;
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -v Reading specs from /Developer/Pascal/gpc332d1/lib/gcc-lib/powerpc-apple-darwin/3.3.2/specs Configured with: ../gpc-332d1/configure --enable-languages=pascal,c --prefix=/Developer/Pascal/gpc332d1 --enable-threads=posix --target=powerpc-apple-darwin Thread model: posix gpc version 20030830, based on gcc-3.3.2
[G4:~/gnu/testgpc/adriaan] adriaan% objdump -v GNU objdump 2.13.90 20030128 Copyright 2002 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty.
On Thu, 30 Oct 2003, Adriaan van Os wrote:
The output below from objdump suggests that stabs debugging info from gpc is broken. Does this happen on other platforms also ?
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c hello.pas -g [G4:~/gnu/testgpc/adriaan] adriaan% objdump -g hello.o
Just tried it here. Never used objdump before so not sure what I should get, but this is what I got:
hello.o: file format elf32-i386
objdump: hello.o: no recognized debugging information
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs Configured with: ../gcc-3.3.2/configure --enable-languages=pascal --enable-threads=posix --enable-__cxa_atexit : (reconfigured) ../gcc-3.3.2/configure --enable-languages=pascal --enable-threads=posix --enable-__cxa_atexit Thread model: posix gpc version 20030830, based on gcc-3.3.2
Russ
Adriaan van Os wrote:
The output below from objdump suggests that stabs debugging info from gpc is broken. Does this happen on other platforms also ?
On i386 with -gstabs+ I have the same problem. It seems that in the stab: .stabs "Timestamp:t(0,4)=s104Datevalid:(0,5)=@s8;-16;,0,1;Timevalid.... ^ the semicolon should be ommited. Looks like backend bug. Do not appear if I give -gstabs (without GNU extensions).
Waldek Hebisch wrote:
Adriaan van Os wrote:
The output below from objdump suggests that stabs debugging info from gpc is broken. Does this happen on other platforms also ?
On i386 with -gstabs+ I have the same problem. It seems that in the stab: .stabs "Timestamp:t(0,4)=s104Datevalid:(0,5)=@s8;-16;,0,1;Timevalid.... ^ the semicolon should be ommited. Looks like backend bug. Do not appear if I give -gstabs (without GNU extensions).
You are right, it doesn't happen with -gstabs !
Is there a way we can patch this and/or report it to the backend team ?
Regards,
Adriaan van Os
Adriaan van Os wrote:
Waldek Hebisch wrote:
Adriaan van Os wrote:
The output below from objdump suggests that stabs debugging info from gpc is broken. Does this happen on other platforms also ?
On i386 with -gstabs+ I have the same problem. It seems that in the stab: .stabs "Timestamp:t(0,4)=s104Datevalid:(0,5)=@s8;-16;,0,1;Timevalid.... ^ the semicolon should be ommited. Looks like backend bug. Do not appear if I give -gstabs (without GNU extensions).
You are right, it doesn't happen with -gstabs !
Is there a way we can patch this and/or report it to the backend team ?
The following works for me:
diff -ru gcc-3.3.2.orig/gcc/dbxout.c gcc-3.3.2/gcc/dbxout.c --- gcc-3.3.2.orig/gcc/dbxout.c Fri Oct 31 21:23:40 2003 +++ gcc-3.3.2/gcc/dbxout.c Sat Nov 1 00:08:30 2003 @@ -1375,7 +1375,7 @@ fputs ("@s", asmfile); CHARS (2); print_wide_int (BITS_PER_UNIT * int_size_in_bytes (type)); - fputs (";-20;", asmfile); + fputs (";-20", asmfile); CHARS (4); } else @@ -1397,7 +1397,7 @@ fputs ("@s", asmfile); CHARS (2); print_wide_int (BITS_PER_UNIT * int_size_in_bytes (type)); - fputs (";-16;", asmfile); + fputs (";-16", asmfile); CHARS (4); } else /* Define as enumeral type (False, True) */
Waldek Hebisch wrote:
The following works for me:
Thanks for the patch ! It works for me also and I have reported it to gcc bugzilla, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12869
Regards,
Adriaan van Os
Waldek Hebisch wrote:
The following works for me:
I forgot to mention that I get a number of warnings:
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c -o hello.o hello.pas -gstabs+ [G4:~/gnu/testgpc/adriaan] adriaan% objdump hello.o -g >> /dev/null
hello.o: file format mach-o-be
Warning: changing type size from 1 to 4 Warning: changing type size from 4 to 1 Warning: changing type size from 1 to 2 Warning: changing type size from 2 to 4 Warning: changing type size from 4 to 8
Also, I experimented with a modified version of the testsuite (adding objdump a.out >> /dev/null). This reveals more stab problems, for example:
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -o adam2 adam2.pas -gstabs+ --automake [G4:~/gnu/testgpc/adriaan] adriaan% objdump adam2 -g >> /dev/null Warning: changing type size from 1 to 4 Warning: changing type size from 4 to 1 Warning: changing type size from 1 to 2 Warning: changing type size from 2 to 4 Warning: changing type size from 4 to 8 Warning: changing type size from 8 to 1 Warning: changing type size from 1 to 4 Warning: changing type size from 4 to 1 Warning: changing type size from 1 to 2 Warning: changing type size from 2 to 4 Warning: changing type size from 4 to 8 bad mangled name `Mlist_Init' Last stabs entries before error: n_type n_desc n_value string LSYM 0 0000000000000000 Shortbool:t(0,58)=@s16;-16 LSYM 0 0000000000000000 Wordbool:t(0,59)=@s32;-16 LSYM 0 0000000000000000 Medbool:t(0,60)=@s32;-16 LSYM 0 0000000000000000 Longbool:t(0,61)=@s64;-16 LSYM 0 0000000000000000 Longestbool:t(0,62)=@s64;-16 LSYM 0 0000000000000000 Void:t(0,23) LSYM 0 0000000000000000 Pobjecttype:t(0,63)=*(0,64)=s16Size:(0,38),0,32;Negatedsize:(0,50),32,32 ;Parent:(0,63),64,32;Name:(0,65)=*(0,66)=k(0,67)=s12Capacity:(0,14),0,32 ;length:(0,14),32,32;_p_Schema_:(0,68)=ar(0,1);1;1;(0,2),64,8;;,96,32;; LSYM 0 0000000000000000 Cstring:t(0,69)=*(0,2) LSYM 0 0000000000000000 String:t(0,67) LSYM 0 0000000000000000 Integer:t(0,70)=r(0,70);-2147483648;2147483647; LSYM 0 0000000000000000 Real:t(0,71)=r(0,1);8;0; LSYM 0 0000000000000000 Boolean:t(0,5) LSYM 0 0000000000000000 Char:t(0,72)=@s8;-20 LSYM 0 0000000000000000 Text:t(0,73)=s16712_p_File_:(0,74)=ar(0,19);1;4178;(0,1),0,133696;; LSYM 0 0000000000000000 Anyfile:t(0,75)=s16712_p_File_:(0,76)=ar(0,19);1;4178;(0,1),0,133696;; LSYM 6 0000000000000000 Mlist:t(0,77)=s4vmt:(0,78)=*(0,79)=s16Size:(0,38),0,32;Negatedsize:(0,50 ),32,32;Parent:(0,63),64,32;Name:(0,65),96,32;;,0,32;Init::(0,80)=f(0,5) :Mlist_Init;2A?;;
Regards,
Adriaan van Os
Adriaan van Os wrote:
I forgot to mention that I get a number of warnings:
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c -o hello.o hello.pas -gstabs+ [G4:~/gnu/testgpc/adriaan] adriaan% objdump hello.o -g >> /dev/null
hello.o: file format mach-o-be
Warning: changing type size from 1 to 4 Warning: changing type size from 4 to 1 Warning: changing type size from 1 to 2 Warning: changing type size from 2 to 4 Warning: changing type size from 4 to 8
The warnings seem harmless. I do not get two first on i386, the last three are about `Shortbool', `Wordbool' and `Longbool'.
Also, I experimented with a modified version of the testsuite (adding objdump a.out >> /dev/null). This reveals more stab problems, for example:
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -o adam2 adam2.pas -gstabs+ --automake
I do not expect quick solution (if ever...) to this problem. Stabs debugging format encodes types of methods in assembler names. I do not know if we can make it work for Pascal, the encoding was designed only for C++. And even for C++ stab method was limiting, so DWARF-2 was invented.
I will look at the problem, it is closely related to qualified identifiers. Thanks for the report.
Waldek Hebisch wrote (1 nov 2003):
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -o adam2 adam2.pas -gstabs+ --automake
I do not expect quick solution (if ever...) to this problem. Stabs debugging format encodes types of methods in assembler names. I do not know if we can make it work for Pascal, the encoding was designed only for C++. And even for C++ stab method was limiting, so DWARF-2 was invented.
I will look at the problem, it is closely related to qualified identifiers. Thanks for the report.
There may be some more stab problems, found when running the testsuite with an added "objdump a.out >> /dev/null"
Bad stab: (0,75);-32;31; Last stabs entries before error: n_type n_desc n_value string LSYM 0 0000000000000000 Text:t(0,73)=s4_p_File_:(0,22),0,32;; LSYM 0 0000000000000000 Anyfile:t(0,74)=s4_p_File_:(0,22),0,32;; LSYM 3 0000000000000000 Xxx:t(0,75)=@s6;r(0,75);-32;31;
Bad stab: (0,75);-65536;65535; Last stabs entries before error: n_type n_desc n_value string LSYM 0 0000000000000000 Text:t(0,73)=s4_p_File_:(0,22),0,32;; LSYM 0 0000000000000000 Anyfile:t(0,74)=s4_p_File_:(0,22),0,32;; LSYM 4 0000000000000000 Int17:t(0,75)=@s17;r(0,75);-65536;65535;
Bad stab: (0,75);-4096;4095; Last stabs entries before error: n_type n_desc n_value string SLINE 1 0000000000002268 FUN 14 0000000000002170 pascal_main_program:F(0,23) LSYM 6 0000000000000068 X:(0,75)=@s13;r(0,75);-4096;4095;
Bad stab: (0,77);0;32767; Last stabs entries before error: n_type n_desc n_value string LSYM 26 0000000000000000 Cj:t(0,75)=@s64;r(0,75);0000000000000;01777777777777777777777; LSYM 25 0000000000000000 Ci:t(0,76)=@s42;r(0,76);0000000000000;077777777777777; LSYM 24 0000000000000000 Ch:t(0,77)=@s15;r(0,77);0;32767;
Bad stab: (0,76);0;1; Last stabs entries before error: n_type n_desc n_value string 14 0 000000000002fea0 _Dummy LSYM 108 0000000000000000 I:t(0,75)=@s1;r(0,75);-1;0; LSYM 108 0000000000000000 C:t(0,76)=@s1;r(0,76);0;1;
Bad stab: (0,87);-16;15; Last stabs entries before error: n_type n_desc n_value string LSYM 55 0000000000000000 T:t(0,81)=s12D:(0,82)=r(0,82);- 2147483648;2147483647;,0,32;_p_Schema_:(0,83)=ar(0,84)=r(0,84);- 2147483648;2147483647;;1;2;(0,85)=r(0,85);- 2147483648;2147483647;,32,64;; LSYM 65 0000000000000000 T:t(0,86)=r(0,1);5;10; LSYM 75 0000000000000000 T:t(0,87)=@s5;r(0,87);-16;15;
[G4:~] adriaan% gpc -v Reading specs from /Developer/Pascal/gpc332d7/lib/gcc-lib/powerpc-apple-darwin/3.3.2/specs Configured with: ../gpc-332d6a1/configure --enable-languages=pascal,c --target=powerpc-apple-darwin --host=powerpc-apple-darwin --enable-threads=posix --prefix=/Developer/Pascal/gpc332d7 Thread model: posix gpc version 20040516, based on gcc-3.3.2
Regards,
Adriaan van Os
Waldek Hebisch wrote:
The following works for me:
diff -ru gcc-3.3.2.orig/gcc/dbxout.c gcc-3.3.2/gcc/dbxout.c --- gcc-3.3.2.orig/gcc/dbxout.c Fri Oct 31 21:23:40 2003 +++ gcc-3.3.2/gcc/dbxout.c Sat Nov 1 00:08:30 2003 @@ -1375,7 +1375,7 @@ fputs ("@s", asmfile); CHARS (2); print_wide_int (BITS_PER_UNIT * int_size_in_bytes (type));
fputs (";-20;", asmfile);
CHARS (4); } elsefputs (";-20", asmfile);
@@ -1397,7 +1397,7 @@ fputs ("@s", asmfile); CHARS (2); print_wide_int (BITS_PER_UNIT * int_size_in_bytes (type));
fputs (";-16;", asmfile);
CHARS (4); } else /* Define as enumeral type (False, True) */fputs (";-16", asmfile);
Thanks. Works for me too, also on gcc-3.2, gcc-2.95 and (similarly) gcc-2.8.1 (I can provide a patch for the latter if anyone is interested).
BTW, is it only these two places, not e.g. the line fprintf (asmfile, ";0;%d;", TREE_UNSIGNED (type) ? 255 : 127); (in case CHAR_TYPE) or the line fputs (";0;", asmfile); (in case REAL_TYPE)? I can't really read stabs, so I don't know where there must be a semicolon.
Frank
Frank Heckenbach wrote:
Thanks. Works for me too, also on gcc-3.2, gcc-2.95 and (similarly) gcc-2.8.1 (I can provide a patch for the latter if anyone is interested).
BTW, is it only these two places, not e.g. the line fprintf (asmfile, ";0;%d;", TREE_UNSIGNED (type) ? 255 : 127); (in case CHAR_TYPE) or the line fputs (";0;", asmfile); (in case REAL_TYPE)? I can't really read stabs, so I don't know where there must be a semicolon.
I have not checked all cases, but typically stabs seem to require ending semicolon. In the two cases I changed the negative number is reference to a builtin type. For such reference stabs manual gives examples without semicolon (and objdump do not want semicolon too), so I assume that version without semicolon is correct.
AFAIKS only in two places such construct was used. Maybe I missed something, but gcc typically prefers other constructs.