From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16006 invoked by alias); 26 Sep 2007 12:25:51 -0000 Received: (qmail 15971 invoked by uid 22791); 26 Sep 2007 12:25:50 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Sep 2007 12:25:44 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id B786B18701C; Wed, 26 Sep 2007 14:30:36 +0200 (CEST) From: "Pierre Muller" To: Cc: "'Jonas Maebe'" Subject: [PATCH] Fix PR pascal/2283 Date: Wed, 26 Sep 2007 12:25:00 -0000 Message-ID: <002f01c80038$5881a880$0984f980$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us 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: 2007-09/txt/msg00360.txt.bz2 This patch fixes the display of char arrays for pascal language as reported by Jonas Maebe in the GDB bugs database. ChangeLog entry: 2007-09-26 Pierre Muller * Fix PR pascal/2283 p-valprint.c (pascal_val_print): correct current language check. Also print array of char as strings. $ cvs diff -up p-valprint.c Index: 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 RCS file: /cvs/src/src/gdb/p-valprint.c,v retrieving revision 1.51 diff -u -p -r1.51 p-valprint.c --- p-valprint.c 7 Sep 2007 12:34:55 -0000 1.51 +++ p-valprint.c 26 Sep 2007 12:14:19 -0000 @@ -87,7 +87,7 @@ pascal_val_print (struct type *type, con /* For an array of chars, print with string syntax. */ if (eltlen =3D=3D 1 && ((TYPE_CODE (elttype) =3D=3D TYPE_CODE_INT) - || ((current_language->la_language =3D=3D language_m2) + || ((current_language->la_language =3D=3D language_pascal) && (TYPE_CODE (elttype) =3D=3D TYPE_CODE_CHAR))) && (format =3D=3D 0 || format =3D=3D 's')) { @@ -170,7 +170,8 @@ pascal_val_print (struct type *type, con /* For a pointer to char or unsigned char, also print the string pointed to, unless pointer is null. */ if (TYPE_LENGTH (elttype) =3D=3D 1 - && TYPE_CODE (elttype) =3D=3D TYPE_CODE_INT + && (TYPE_CODE (elttype) =3D=3D TYPE_CODE_INT + || TYPE_CODE(elttype) =3D=3D TYPE_CODE_CHAR) && (format =3D=3D 0 || format =3D=3D 's') && addr !=3D 0) { Pierre Muller Charg=E9 de recherches Institut Charles Sadron 6, rue Boussingault F 67083 Strasbourg Cedex T=E9l.=A0: +(33)3-88-41-40-07 Email=A0: pierre.muller@ics.u-strasbg.fr