[Bug debug/12869] New: Bad stabs for bitsize fields
gcc at microbizz dot nl
gcc-bugzilla@gcc.gnu.org
Sat Nov 1 11:05:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12869
Summary: Bad stabs for bitsize fields
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc at microbizz dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-apple-darwin (and other platforms)
GCC host triplet: powerpc-apple-darwin (and other platforms)
GCC target triplet: powerpc-apple-darwin (and other platforms)
-gstabs+ generates bad stabs for bitsize fields.
-gstabs (without GNU extensions) does not have this problem.
Please note that on some platforms -gstabs+ is the default.
Consequently, -g and -ggdb will produce the same error.
Consider the following type definition, taken from the GNU Pascal runtime
library (time.pas)
const
DateTimeLength = 11; { MUST match constants.h }
type
DateTimeString = String (DateTimeLength);
GPC_TimeStamp = packed record
DateValid,
TimeValid : Boolean;
Year : Integer;
Month : 1 .. 12;
Day : 1 .. 31;
DayOfWeek : 0 .. 6; { 0 means Sunday }
Hour : 0 .. 23;
Minute : 0 .. 59;
Second : 0 .. 61; { to allow for leap seconds }
MicroSecond: 0 .. 999999;
TimeZone : Integer; { in seconds east of UTC }
DST : Boolean;
TZName1,
TZName2 : String (32);
end;
Through the runtime library, GPC_TimeStamp is included in the debug information
for hello.pas.
[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% gpc -c -o hello.o hello.pas -g
[G4:~/gnu/testgpc/adriaan] adriaan% objdump hello.o -g
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);0000000000000;0037777777777;,0,32;length:(0,14),32,32;_p_Schema_:(0,15)=ar(0,1);1;33;(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);0000000000000;0037777777777;,0,32;length:(0,14),32,32;_p_Schema_:(0,15)=ar(0,1);1;33;(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;;
...
The problem is the semicolon after "=@s8;-16" that should not be there.
Waldek Hebisch has provided a patch that solves the problem:
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) */
Regards,
Adriaan van Os
www.microbizz.nl/gpc.html
More information about the Gcc-bugs
mailing list