Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix PR pascal/2283
@ 2007-09-26 12:25 Pierre Muller
  2007-09-26 13:49 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Pierre Muller @ 2007-09-26 12:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: 'Jonas Maebe'

  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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-09-26 14:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-26 12:25 [PATCH] Fix PR pascal/2283 Pierre Muller
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox