From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29157 invoked by alias); 10 Feb 2009 15:00:58 -0000 Received: (qmail 29131 invoked by uid 22791); 10 Feb 2009 15:00:56 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Feb 2009 15:00:49 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n1AExQWq088635 ; Tue, 10 Feb 2009 15:59:26 +0100 (CET) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n1AExQ0b090294 ; Tue, 10 Feb 2009 15:59:26 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n1AExQAq084381 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Tue, 10 Feb 2009 15:59:26 +0100 (CET) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Jonas Maebe'" Cc: "'gdb-patches ml'" , "'FPC Core Developer List'" , References: <000001c98b14$a4cb8d60$ee62a820$@u-strasbg.fr> <85964EC7-B6FF-4869-A5C1-B99D618FF69C@elis.ugent.be> In-Reply-To: <85964EC7-B6FF-4869-A5C1-B99D618FF69C@elis.ugent.be> Subject: RE: [Commit] gdb/pascal language 2 or 4 byte char support in strings Date: Tue, 10 Feb 2009 15:00:00 -0000 Message-ID: <002801c98b90$2b9c60f0$82d522d0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00221.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Jonas Maebe > Envoy=E9=A0: Tuesday, February 10, 2009 3:32 PM > =C0=A0: Pierre Muller > Cc=A0: 'gdb-patches ml'; 'FPC Core Developer List'; gpc@gnu.de > Objet=A0: Re: [Commit] gdb/pascal language 2 or 4 byte char support in > strings >=20 >=20 > On 10 Feb 2009, at 01:15, Pierre Muller wrote: >=20 > > I committed the patch below to add > > support for fixed width chars > > greater than 1 for pascal language. > > > > This works nicely for Free Pascal, > > I couldn't test it for GPC > > because I didn't find out if those kind of char are supported... >=20 > Hi Pierre, >=20 > A while ago I wrote a similar patch. I didn't submit it yet because I > didn't find time to write explanations why I did everything and on > writing test cases for all changes. >=20 > Anyway, it's in attachment (it's against the p-*.c files before your > patch though). Some comments: > * pascal-dwarf-char.patch: > This one is independent from and complementary to your patch : it > properly sets the TYPE_CODE DW_ATE_signed_char/DW_ATE_unsigned_char to > TYPE_CODE_CHAR in case of Pascal (rather than only for Ada and Modula- > 2) OK, I will submit this patch to the dwarf maintainer. =20 > * pascalchar.patch: > a) I removed all situations in the Pascal string handling where > "TYPE_CODE (elttype) =3D=3D TYPE_CODE_INT" is interpreted as a character. > I don't know the original reason for having it there though, but maybe > it was because of the lack of a)? At least the stabs debug info of both > FPC and GPC results in a char (negative type number -2, as mentioned at > http://sourceware.org/gdb/current/onlinedocs/stabs_5.html#SEC35) I agree with you with one exception: I think that TYPE_CODE_INT should be accepted if the /s format option was specified. > , which gdb turns into a TYPE_CODE_CHAR. I don't know about GPC and > Dwarf, but FPC and Dwarf results in DW_ATE_unsigned_char. The main > problem with considering TYPE_CODE_INT as characters is that arrays of > bytes (and now presumably also of words and cardinals) are printed as > character arrays, which is quite annoying. > b) my changes to p-lang.c were basically a copy/paste if all changes in > the C version of print_string to support characters of different widths I will try to modify the pascal code so that=20 only TYPE_CODE_CHAR and /s generated string output. Pierre Muller Pascal language support maintainer for GDB