From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17512 invoked by alias); 16 May 2010 21:49:40 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 17483 invoked by uid 22791); 16 May 2010 21:49:39 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Subject: Re: Patch for pascal-dynamic arrays Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Jonas Maebe In-Reply-To: <20100516172301.GA4685@host0.dyn.jankratochvil.net> Date: Sun, 16 May 2010 21:49:00 -0000 Cc: Joost van der Sluis , Project Archer Content-Transfer-Encoding: quoted-printable Message-Id: <9D126914-010D-4AE0-BFBA-DE55D17C9E61@elis.ugent.be> References: <1271071502.27845.15.camel@wsjoost.cnoc.lan> <20100412195106.GA32767@host0.dyn.jankratochvil.net> <1271241292.21465.18.camel@wsjoost.cnoc.lan> <20100506230504.GA21919@host0.dyn.jankratochvil.net> <1273874250.9996.33.camel@wsjoost.cnoc.lan> <20100514224613.GA3338@host0.dyn.jankratochvil.net> <1273955042.32006.31.camel@wsjoost.cnoc.lan> <20100515214421.GA9965@host0.dyn.jankratochvil.net> <4719101D-98D9-4000-9794-838695CDA95D@elis.ugent.be> <1274029467.5331.24.camel@wsjoost.cnoc.lan> <20100516172301.GA4685@host0.dyn.jankratochvil.net> To: Jan Kratochvil X-j-chkmail-Enveloppe: 4BF06867.003/91.182.44.192/[91.182.44.192]/[192.168.1.2]/ X-j-chkmail-Score: MSGID : 4BF06867.003 on smtp1.UGent.be : j-chkmail score : . : R=. U=. O=. B=0.000 -> S=0.000 X-j-chkmail-Status: Ham X-SW-Source: 2010-q2/txt/msg00029.txt.bz2 On 16 May 2010, at 19:23, Jan Kratochvil wrote: > That's correct. Both DW_AT_lower_bound and DW_AT_upper_bound express the > boundaries inclusively. Array of length 0 must have DW_AT_upper_bound eq= ual > to DW_AT_lower_bound minus one. I've fixed this, thanks. I've also committed the patch to FPC svn. > I am not sure where is a problem there but GDB handles non-pascal arrays = of > length zero right AFAIK. Thanks to your patch, I can now successfully build the new gdb on SL54. In = Pascal language mode, both empty arrays and strings are printed as '0x0'. T= hat's probably an issue in the Pascal value printer. In C language mode (wi= th the same binary), an empty string is (correctly) printed as '0x625418 ""= ', while an empty array is printed as just the address of the variable cont= aining the pointer to the array (which looks a bit strange, but I guess it'= s consistent with how in C arrays and pointers are pretty much the same). Array: 19 setlength(a,8); (gdb) set lang pascal (gdb) ptype a type =3D array [0..-1] of LongInt (gdb) p a $12 =3D 0x0 (gdb) set lang c (gdb) ptype a type =3D LongInt [0] (gdb) p a $13 =3D 0x625418 (gdb) n 20 a[0]:=3D5; (gdb) set lang pascal (gdb) ptype a type =3D array [0..7] of LongInt (gdb) p a $14 =3D {0, 0, 0, 0, 0, 0, 0, 0} (gdb) set lang c (gdb) ptype a type =3D LongInt [8] (gdb) p a $15 =3D {0, 0, 0, 0, 0, 0, 0, 0} String: 45 setlength(s,8); (gdb) set lang pascal (gdb) ptype s type =3D array [1..0] of Char (gdb) p s $16 =3D 0x0 (gdb) set lang c (gdb) ptype s type =3D Char [0] (gdb) p s $17 =3D 0x625428 "" (gdb) n 46 s[1]:=3Dchr(5); (gdb) set lang pascal (gdb) ptype s type =3D array [1..8] of Char (gdb) p s $18 =3D #0#0#0#0#0#0#0 (gdb) set lang c (gdb) ptype s type =3D Char [8] (gdb) p s $19 =3D "\000\000\000\000\000\000\000" Jonas