From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32234 invoked by alias); 14 May 2009 13:59:52 -0000 Received: (qmail 32224 invoked by uid 22791); 14 May 2009 13:59:50 -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.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 May 2009 13:59:44 +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 n4EDxfOB065569 ; Thu, 14 May 2009 15:59:41 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n4EDxeDh046554 ; Thu, 14 May 2009 15:59:41 +0200 (CEST) (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 n4EDxeZP017329 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 14 May 2009 15:59:40 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Ulrich Weigand'" , References: <200905141134.n4EBYOaS032369@d12av02.megacenter.de.ibm.com> In-Reply-To: <200905141134.n4EBYOaS032369@d12av02.megacenter.de.ibm.com> Subject: RE: [rfc] Minor cleanup to pascal_val_print Date: Thu, 14 May 2009 13:59:00 -0000 Message-ID: <000f01c9d49c$3e204a20$ba60de60$@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-05/txt/msg00300.txt.bz2 This patch is OK, even though I am not sure this part can ever be called... I am not sure that there is an equivalent of C++ reference type in pascal language... But I might as well be wrong! Anyhow, I don't want to remove it either, as it might be useful. Patch is approved, please check it in. Pierre Muller Pascal language support maintainer for GDB Pierre > -----Message d'origine----- > De=A0: Ulrich Weigand [mailto:uweigand@de.ibm.com] > Envoy=E9=A0: Thursday, May 14, 2009 1:34 PM > =C0=A0: gdb-patches@sourceware.org; muller@ics.u-strasbg.fr > Objet=A0: [rfc] Minor cleanup to pascal_val_print >=20 > Hello, >=20 > p-valprint.c uses "extract_unsigned_integer" to extract the value of a > reference in order to print it, explicitly using gdbarch_ptr_bit as > length. The corresponding location in the val_print routine of all > other languages (except Ada) simply uses extract_typed_address to get > at that value. >=20 > The patch below changes pascal_val_print to do the same thing, getting > rid of a current_gdbarch instance in the process. >=20 > Pierre, is there any reason why this would be wrong for Pascal? >=20 > Bye, > Ulrich >=20 >=20 > ChangeLog: >=20 > * p-valprint.c (pascal_val_print): Use extract_typed_address > to extract reference value. >=20 > Index: gdb-head/gdb/p-valprint.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gdb-head.orig/gdb/p-valprint.c > +++ gdb-head/gdb/p-valprint.c > @@ -251,11 +251,10 @@ pascal_val_print (struct type *type, con > elttype =3D check_typedef (TYPE_TARGET_TYPE (type)); > if (options->addressprint) > { > + CORE_ADDR addr > + =3D extract_typed_address (valaddr + embedded_offset, type); > fprintf_filtered (stream, "@"); > - /* Extract the address, assume that it is unsigned. */ > - fputs_filtered (paddress ( > - extract_unsigned_integer (valaddr + embedded_offset, > - gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT)), > stream); > + fputs_filtered (paddress (addr), stream); > if (options->deref_ref) > fputs_filtered (": ", stream); > } > -- > Dr. Ulrich Weigand > GNU Toolchain for Linux on System z and Cell BE > Ulrich.Weigand@de.ibm.com