aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>2000-10-26 07:41:25 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>2000-10-26 07:41:25 +0000
commitf517ea4ebb7d0c85a5c7850757b2f1d6716e2dcf (patch)
tree7a72b4773df10c1d31950a0509650a314b8e6816 /gdb/rs6000-tdep.c
parentba181e2f16dcf24ec7336b1f358f54fce72af42b (diff)
downloadgdb-f517ea4ebb7d0c85a5c7850757b2f1d6716e2dcf.zip
gdb-f517ea4ebb7d0c85a5c7850757b2f1d6716e2dcf.tar.gz
gdb-f517ea4ebb7d0c85a5c7850757b2f1d6716e2dcf.tar.bz2
* arch-utils.c, arch-utils.h (default_convert_from_func_ptr_addr):
New function. * gdbarch.sh (CONVERT_FROM_FUNC_PTR_ADDR): Add. * gdbarch.c, gdbarch.h: Regenerate. * valops.c (find_function_addr): Use CONVERT_FROM_FUNC_PTR_ADDR unconditionally. * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR): Delete definition. * config/powerpc/tm-linux.h (CONVERT_FROM_FUNC_PTR_ADDR): Remove undef. * rs6000-tdep.c (rs6000_convert_from_func_ptr_addr): Fix comment. (rs6000_gdbarch_init): Register rs6000_convert_from_func_ptr_addr if not ELFOSABI_LINUX.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index fa06340..252ea77 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1541,11 +1541,11 @@ rs6000_create_inferior (int pid)
a function pointer would require allocation of a TOC entry in the
inferior's memory space, with all its drawbacks. To be able to
call C++ virtual methods in the inferior (which are called via
- function pointers), find_function_addr uses this macro to get the
+ function pointers), find_function_addr uses this function to get the
function address from a function pointer. */
-/* Return nonzero if ADDR (a function pointer) is in the data space and
- is therefore a special function pointer. */
+/* Return real function address if ADDR (a function pointer) is in the data
+ space and is therefore a special function pointer. */
CORE_ADDR
rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
@@ -2196,6 +2196,10 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs);
set_gdbarch_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info);
+
+ /* Handle RS/6000 function pointers. */
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ rs6000_convert_from_func_ptr_addr);
}
set_gdbarch_frame_args_address (gdbarch, rs6000_frame_args_address);
set_gdbarch_frame_locals_address (gdbarch, rs6000_frame_args_address);