summaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2010-04-21 09:54:58 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2010-04-21 09:54:58 +0000
commitc2ca0c40da5e38e72592a07d3db8e3304ca24128 (patch)
tree7d47e7a0c30ab82e27642d2275aff8dd3f377dfe /gdb/p-valprint.c
parent135d95fa2aeb55f8100bd7f98f086b06b1b85b12 (diff)
downloadgdb-c2ca0c40da5e38e72592a07d3db8e3304ca24128.tar.gz
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 3bc9c55eaac..d38aa421f1d 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. */