From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 468 invoked by alias); 1 Nov 2003 11:05:36 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 457 invoked by uid 48); 1 Nov 2003 11:05:35 -0000 Date: Sat, 01 Nov 2003 11:05:00 -0000 From: "gcc at microbizz dot nl" To: gcc-bugs@gcc.gnu.org Message-ID: <20031101110525.12869.gcc@microbizz.nl> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug debug/12869] New: Bad stabs for bitsize fields X-Bugzilla-Reason: CC X-SW-Source: 2003-11/txt/msg00029.txt.bz2 List-Id: 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