aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/p-lang.c')
-rw-r--r--gdb/p-lang.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 08738ac..64d2e9f 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -222,7 +222,11 @@ pascal_printstr (struct ui_file *stream, struct type *type,
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
- int width = TYPE_LENGTH (type);
+ int width;
+
+ /* Preserve TYPE's original type, just set its LENGTH. */
+ check_typedef (type);
+ width = TYPE_LENGTH (type);
/* If the string was not truncated due to `set print elements', and
the last byte of it is a null, we don't print that, in traditional C