summaryrefslogtreecommitdiff
path: root/gdb/m32c-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2008-12-13 00:39:52 +0000
committerKevin Buettner <kevinb@redhat.com>2008-12-13 00:39:52 +0000
commit9e3c9b86cf7b0713cf1480d0c6488f5051425f0a (patch)
tree190341b24082baf5ea539a71d3c876024f360e10 /gdb/m32c-tdep.c
parent6b96c9a3f78b7128e397bcfde4bc6e5501344eba (diff)
downloadgdb-9e3c9b86cf7b0713cf1480d0c6488f5051425f0a.tar.gz
* gnu-v3-abi.c (vtable_ptrdiff_type): New function.
(gnuv3_decode_method_ptr, gnuv3_print_method_ptr) (gnuv3_method_ptr_to_value): Use a better approximation for `ptrdiff_t' instead of `long'. * m32c-tdep.c (m32c_gdbarch_init): Call set_gdbarch_vbit_in_delta(). (m32c_push_dummy_call): Dereference pointer type.
Diffstat (limited to 'gdb/m32c-tdep.c')
-rw-r--r--gdb/m32c-tdep.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index b8cd1675c31..2dc41d34d01 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -2018,6 +2018,10 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
struct type *func_type = value_type (function);
+ /* Dereference function pointer types. */
+ if (TYPE_CODE (func_type) == TYPE_CODE_PTR)
+ func_type = TYPE_TARGET_TYPE (func_type);
+
gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC ||
TYPE_CODE (func_type) == TYPE_CODE_METHOD);
@@ -2596,6 +2600,16 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_virtual_frame_pointer (arch, m32c_virtual_frame_pointer);
+ /* m32c function boundary addresses are not necessarily even.
+ Therefore, the `vbit', which indicates a pointer to a virtual
+ member function, is stored in the delta field, rather than as
+ the low bit of a function pointer address.
+
+ In order to verify this, see the definition of
+ TARGET_PTRMEMFUNC_VBIT_LOCATION in gcc/defaults.h along with the
+ definition of FUNCTION_BOUNDARY in gcc/config/m32c/m32c.h. */
+ set_gdbarch_vbit_in_delta (arch, 1);
+
return arch;
}