aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2010-04-21 09:54:59 +0000
committerPierre Muller <muller@sourceware.org>2010-04-21 09:54:59 +0000
commit6e354e5ec2032adf0ded5fd21ffc9a717094dc69 (patch)
tree7c1b35ba3a015768bf2025e44c3b7bcf2366a39d /gdb/p-valprint.c
parent57174f3173f42762234548edd64f0a893edbcd9b (diff)
downloadgdb-6e354e5ec2032adf0ded5fd21ffc9a717094dc69.zip
gdb-6e354e5ec2032adf0ded5fd21ffc9a717094dc69.tar.gz
gdb-6e354e5ec2032adf0ded5fd21ffc9a717094dc69.tar.bz2
gdb ChangeLog
PR pascal/11492. * p-valprint.c (pascal_val_print): Fix default printing of integer arrays. gdb/testsuite ChangeLog PR pascal/11492. * gdb.pascal/gdb11492.pas: New file. * gdb.pascal/gdb11492.exp: New file.
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r--gdb/p-valprint.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 3bc9c55..d38aa42 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -80,12 +80,13 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
- /* For an array of chars, print with string syntax. */
- if ((eltlen == 1 || eltlen == 2 || eltlen == 4)
- && ((TYPE_CODE (elttype) == TYPE_CODE_INT)
- || ((current_language->la_language == language_pascal)
- && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
- && (options->format == 0 || options->format == 's'))
+ /* If 's' format is used, try to print out as string.
+ If no format is given, print as string if element type
+ is of TYPE_CODE_CHAR and element size is 1,2 or 4. */
+ if (options->format == 's'
+ || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
+ && TYPE_CODE (elttype) == TYPE_CODE_CHAR
+ && options->format == 0))
{
/* If requested, look for the first null char and only print
elements up to it. */