Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Cc: "'Jonas Maebe'" <jonas@freepascal.org>
Subject: [PATCH] Fix PR pascal/2283
Date: Wed, 26 Sep 2007 12:25:00 -0000	[thread overview]
Message-ID: <002f01c80038$5881a880$0984f980$@u-strasbg.fr> (raw)

  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  <muller@ics.u-strasbg.fr>

	* 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
===================================================================
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 == 1
              && ((TYPE_CODE (elttype) == TYPE_CODE_INT)
-              || ((current_language->la_language == language_m2)
+              || ((current_language->la_language == language_pascal)
                   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
              && (format == 0 || format == '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) == 1
-             && TYPE_CODE (elttype) == TYPE_CODE_INT
+             && (TYPE_CODE (elttype) == TYPE_CODE_INT
+                 || TYPE_CODE(elttype) == TYPE_CODE_CHAR)
              && (format == 0 || format == 's')
              && addr != 0)
            {

Pierre Muller
Chargé de recherches
Institut Charles Sadron
6, rue Boussingault
F 67083 Strasbourg Cedex
Tél. : +(33)3-88-41-40-07
Email : pierre.muller@ics.u-strasbg.fr





             reply	other threads:[~2007-09-26 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 12:25 Pierre Muller [this message]
2007-09-26 13:49 ` Eli Zaretskii
2007-09-26 14:02   ` Jonas Maebe
2007-09-26 14:08     ` Eli Zaretskii
2007-09-26 14:12       ` Jonas Maebe
2007-09-26 14:26       ` Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002f01c80038$5881a880$0984f980$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=jonas@freepascal.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox