From 8b7cb1707606825a780f2df5ee95bfbda4549931 Mon Sep 17 00:00:00 2001 From: qiyao Date: Thu, 29 Nov 2012 07:55:10 +0000 Subject: gdb/ 2012-11-29 Yao Qi Tom Tromey * eval.c (evaluate_subexp_standard): Get the correct pointer type for TYPE_CODE_MEMBERPTR. --- gdb/eval.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index 55582e03292..7d48d7e42f4 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1404,13 +1404,15 @@ evaluate_subexp_standard (struct type *expect_type, { struct type *type_ptr = lookup_pointer_type (TYPE_DOMAIN_TYPE (type)); + struct type *target_type_ptr + = lookup_pointer_type (TYPE_TARGET_TYPE (type)); /* Now, convert these values to an address. */ arg2 = value_cast (type_ptr, arg2); mem_offset = value_as_long (arg1); - arg1 = value_from_pointer (type_ptr, + arg1 = value_from_pointer (target_type_ptr, value_as_long (arg2) + mem_offset); arg1 = value_ind (arg1); tem = 1; -- cgit v1.2.1