From 953ac07ed78d7fa016fe4ef551afc513700aa393 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 12 Jul 2010 17:07:11 +0000 Subject: [PATCH] gdb/ * dwarf2read.c (read_subrange_type): Call read_subrange_type. * p-lang.c (pascal_printstr): Likewise. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 2 ++ gdb/p-lang.c | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d1964c1208a..9ebaaf9429c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-07-12 Jan Kratochvil + + * dwarf2read.c (read_subrange_type): Call read_subrange_type. + * p-lang.c (pascal_printstr): Likewise. + 2010-07-09 Tom Tromey * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e4ab034e4ac..d128312cb57 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -6332,6 +6332,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) LONGEST negative_mask; base_type = die_type (die, cu); + /* Preserve BASE_TYPE's original type, just set its LENGTH. */ + check_typedef (base_type); /* The die_type call above may have already set the type for this DIE. */ range_type = get_die_type (die, cu); diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 08738ac2800..64d2e9f9be6 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 -- 2.30.2