* jv-valprint.c (java_val_print): Handle `char' as a special case
authorTom Tromey <tromey@redhat.com>
Thu, 9 May 2002 18:23:41 +0000 (18:23 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 9 May 2002 18:23:41 +0000 (18:23 +0000)
of TYPE_CODE_INT.

gdb/ChangeLog
gdb/jv-valprint.c

index 3e8f9eb787b000e4bd05eb4acd8409c9469b57ad..0595f37571fd4aad27eec5ec8d42b42df7cd8c81 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-09  Tom Tromey  <tromey@redhat.com>
+
+       * jv-valprint.c (java_val_print): Handle `char' as a special case
+       of TYPE_CODE_INT.
+
 2002-05-09  Michael Snyder  <msnyder@redhat.com>
 
        * arm-tdep.c (arm_scan_prologue): Accept strb r(0123),[r11,#-nn],
index 73fff27199b4210ed5ed7cec026e9d9d4e9e8e34..f0fd0f5ea251cc123a960514305150ab597a643f 100644 (file)
@@ -497,18 +497,17 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset,
       return i;
 
     case TYPE_CODE_CHAR:
-      format = format ? format : output_format;
-      if (format)
-       print_scalar_formatted (valaddr, type, format, 0, stream);
-      else
-       LA_PRINT_CHAR ((int) unpack_long (type, valaddr), stream);
-      break;
-
     case TYPE_CODE_INT:
-      /* Can't just call c_val_print because that print bytes as C chars. */
+      /* Can't just call c_val_print because that prints bytes as C
+        chars.  */
       format = format ? format : output_format;
       if (format)
        print_scalar_formatted (valaddr, type, format, 0, stream);
+      else if (TYPE_CODE (type) == TYPE_CODE_CHAR
+              || (TYPE_CODE (type) == TYPE_CODE_INT
+                  && TYPE_LENGTH (type) == 2
+                  && strcmp (TYPE_NAME (type), "char") == 0))
+       LA_PRINT_CHAR ((int) unpack_long (type, valaddr), stream);
       else
        val_print_type_code_int (type, valaddr, stream);
       break;
This page took 0.027313 seconds and 4 git commands to generate.