From ad4820ab42603b59ee496405ce0baa7276a0f537 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 11 Sep 2008 14:24:28 +0000 Subject: * cp-abi.h (cplus_method_ptr_size): Add TO_TYPE parameter. (cplus_make_method_ptr): Add TYPE parameter. * cp-abi.c (cplus_method_ptr_size): Add TO_TYPE parameter. Pass it on to current_cp_abi.method_ptr_size callback. (cplus_make_method_ptr): Add TYPE parameter. Pass it on to current_cp_abi.make_method_ptr callback. * gdbtypes.c (lookup_methodptr_type): Pass target type argument to cplus_method_ptr_size. * valops.c (value_cast): Pass type argument to cplus_make_method_ptr. (value_struct_elt_for_reference): Likewise. * gnu-v3-abi.c (get_class_arch): New function. (vtable_address_point_offset): Add GDBARCH parameter. Use it instead of current_gdbarch. Update all callers. (gnuv3_get_vtable): Likewise. (gnuv3_get_virtual_fn): Likewise. (gnuv3_decode_method_ptr): Likewise. (gnuv3_rtti_type): Call get_class_arch to determine architecture. Use it instead of current_gdbarch. (gnuv3_virtual_fn_field): Likewise. (gnuv3_baseclass_offset): Likewise. (gnuv3_print_method_ptr): Likewise. (gnuv3_method_ptr_to_value): Likewise. (gnuv3_method_ptr_size): Add TYPE parameter. Use it to determine class architecture. Use architecture types instead of builtin types. (gnuv3_make_method_ptr): Likewise. * cp-valprint.c (cp_print_class_member): Expect pointer type instead of class type. Use its length when extracting value. * c-valprint.c (c_val_print): Update call to cp_print_class_member. --- gdb/valops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gdb/valops.c') diff --git a/gdb/valops.c b/gdb/valops.c index 48c2445..1ab88ba 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -473,7 +473,7 @@ value_cast (struct type *type, struct value *arg2) && value_as_long (arg2) == 0) { struct value *result = allocate_value (type); - cplus_make_method_ptr (value_contents_writeable (result), 0, 0); + cplus_make_method_ptr (type, value_contents_writeable (result), 0, 0); return result; } else if (code1 == TYPE_CODE_MEMBERPTR && code2 == TYPE_CODE_INT @@ -2618,7 +2618,8 @@ value_struct_elt_for_reference (struct type *domain, int offset, { result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j))); - cplus_make_method_ptr (value_contents_writeable (result), + cplus_make_method_ptr (value_type (result), + value_contents_writeable (result), TYPE_FN_FIELD_VOFFSET (f, j), 1); } else if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -2641,7 +2642,8 @@ value_struct_elt_for_reference (struct type *domain, int offset, else { result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j))); - cplus_make_method_ptr (value_contents_writeable (result), + cplus_make_method_ptr (value_type (result), + value_contents_writeable (result), VALUE_ADDRESS (v), 0); } } -- cgit v1.1