diff options
author | Kevin Buettner <kevinb@redhat.com> | 2008-12-13 00:39:53 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2008-12-13 00:39:53 +0000 |
commit | ed09d7da47719a337ed84148e371691270ac17a5 (patch) | |
tree | 2e349fce5abeae024cf24587cb81c4a6f7fff230 /gdb/m32c-tdep.c | |
parent | 36dcf92c3e08df5aeb5a140c63a43ba3f9056228 (diff) | |
download | gdb-ed09d7da47719a337ed84148e371691270ac17a5.zip gdb-ed09d7da47719a337ed84148e371691270ac17a5.tar.gz gdb-ed09d7da47719a337ed84148e371691270ac17a5.tar.bz2 |
* 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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index b8cd167..2dc41d3 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; } |