summaryrefslogtreecommitdiff
path: root/gdb/jv-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-05-09 18:23:41 +0000
committerTom Tromey <tromey@redhat.com>2002-05-09 18:23:41 +0000
commit2de3de28bf57dc2f7beb74da69a57c000bdd94e6 (patch)
tree12a73e421e6a67522b4d86bec885198f37451ee9 /gdb/jv-valprint.c
parentf37c5edf18a7bd7b96882e23502693e5960e63b7 (diff)
downloadgdb-2de3de28bf57dc2f7beb74da69a57c000bdd94e6.tar.gz
* jv-valprint.c (java_val_print): Handle `char' as a special case
of TYPE_CODE_INT.
Diffstat (limited to 'gdb/jv-valprint.c')
-rw-r--r--gdb/jv-valprint.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index 73fff27199b..f0fd0f5ea25 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -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;