aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-03-20 22:00:11 +0000
committerTom Tromey <tromey@redhat.com>2009-03-20 22:00:11 +0000
commitcb249c71f6bfb565578d4258eaab9144a45716fe (patch)
treebdd83d740e1e8665d41cb61f8db67d4f22a2779c /gdb/eval.c
parent4bf27aa9bace1519a934017fe12cdc5a60da43ad (diff)
downloadgdb-cb249c71f6bfb565578d4258eaab9144a45716fe.zip
gdb-cb249c71f6bfb565578d4258eaab9144a45716fe.tar.gz
gdb-cb249c71f6bfb565578d4258eaab9144a45716fe.tar.bz2
2009-03-20 Tom Tromey <tromey@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2read.c (process_die): Handle DW_TAG_typedef. * eval.c (evaluate_subexp_standard) <OP_TYPE>: Strip a single typedef. * ada-lang.c (decode_packed_array_type): Call CHECK_TYPEDEF on the SYMBOL_TYPE result. * ada-typeprint.c (print_array_type): Do the NULL check unconditionally.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 1d35571..cc92ebe 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2475,7 +2475,17 @@ evaluate_subexp_standard (struct type *expect_type,
if (noside == EVAL_SKIP)
goto nosideret;
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return allocate_value (exp->elts[pc + 1].type);
+ {
+ struct type *type = exp->elts[pc + 1].type;
+ /* If this is a typedef, then find its immediate target. We
+ use check_typedef to resolve stubs, but we ignore its
+ result because we do not want to dig past all
+ typedefs. */
+ check_typedef (type);
+ if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+ type = TYPE_TARGET_TYPE (type);
+ return allocate_value (type);
+ }
else
error (_("Attempt to use a type name as an expression"));