diff options
author | Pierre Muller <muller@sourceware.org> | 2007-09-26 12:25:16 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2007-09-26 12:25:16 +0000 |
commit | c45f11dab9229c1686dc62f77f2f1651dfd32052 (patch) | |
tree | 58e4a3201a567a79303c2c4b846b81dc68e27853 /gdb/p-valprint.c | |
parent | 59aa1faa754a0e15b6539a38307971d7e7804d5a (diff) | |
download | gdb-c45f11dab9229c1686dc62f77f2f1651dfd32052.zip gdb-c45f11dab9229c1686dc62f77f2f1651dfd32052.tar.gz gdb-c45f11dab9229c1686dc62f77f2f1651dfd32052.tar.bz2 |
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.
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r-- | gdb/p-valprint.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 0f40d6d..2ebbaf8 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -87,7 +87,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, /* 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, const gdb_byte *valaddr, /* 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) { |