gdb/
authorYao Qi <yao@codesourcery.com>
Thu, 29 Nov 2012 07:55:10 +0000 (07:55 +0000)
committerYao Qi <yao@codesourcery.com>
Thu, 29 Nov 2012 07:55:10 +0000 (07:55 +0000)
2012-11-29  Yao Qi  <yao@codesourcery.com>
    Tom Tromey  <tromey@redhat.com>

* eval.c (evaluate_subexp_standard): Get the correct pointer
type for TYPE_CODE_MEMBERPTR.

gdb/ChangeLog
gdb/eval.c

index 1eb4c8f8dc32bc8447a4818c48e89e919ddcc1a8..ac85062d9c85f5b0b2bc1a118aa804ad8de49473 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-29  Yao Qi  <yao@codesourcery.com>
+           Tom Tromey  <tromey@redhat.com>
+
+       * eval.c (evaluate_subexp_standard): Get the correct pointer
+       type for TYPE_CODE_MEMBERPTR.
+
 2012-11-28  Edjunior Machado  <emachado@linux.vnet.ibm.com>
 
        * rs6000-tdep.c (gdb_print_insn_powerpc): Remove info->mach checking,
index 55582e032920cce90a3ae03bbc08d2e5b3f96e4e..7d48d7e42f451c5b791e19547550f7e8905e625b 100644 (file)
@@ -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;