From a513d1e8c0893e74ec26dd38dde8f313d7b8b1ba Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Wed, 5 Jun 2013 20:43:53 +0000 Subject: [PATCH] * gnu-v3-abi.c (gnuv3_skip_trampoline): Handle thunk minimal symbols pointing to function descriptors. --- gdb/ChangeLog | 5 +++++ gdb/gnu-v3-abi.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 61a867d0c22..15f1d89b3d8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-06-05 Luis Machado + + * gnu-v3-abi.c (gnuv3_skip_trampoline): Handle thunk + minimal symbols pointing to function descriptors. + 2013-06-05 Tom Tromey * python/py-utils.c (gdb_pymodule_addobject): Cast away const. diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 6812c1dcd7b..1821f180a55 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -1207,7 +1207,7 @@ gnuv3_get_type_from_type_info (struct value *type_info_ptr) static CORE_ADDR gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc) { - CORE_ADDR real_stop_pc, method_stop_pc; + CORE_ADDR real_stop_pc, method_stop_pc, func_addr; struct gdbarch *gdbarch = get_frame_arch (frame); struct minimal_symbol *thunk_sym, *fn_sym; struct obj_section *section; @@ -1236,6 +1236,16 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc) return 0; method_stop_pc = SYMBOL_VALUE_ADDRESS (fn_sym); + + /* Some targets have minimal symbols pointing to function descriptors + (powerpc 64 for example). Make sure to retrieve the address + of the real function from the function descriptor before passing on + the address to other layers of GDB. */ + func_addr = gdbarch_convert_from_func_ptr_addr (gdbarch, method_stop_pc, + ¤t_target); + if (func_addr != 0) + method_stop_pc = func_addr; + real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, method_stop_pc); if (real_stop_pc == 0) -- 2.30.2