aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-v3-abi.c
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2013-06-05 20:43:53 +0000
committerLuis Machado <luisgpm@br.ibm.com>2013-06-05 20:43:53 +0000
commita513d1e8c0893e74ec26dd38dde8f313d7b8b1ba (patch)
tree07e40d5fcac47b860556fad45e73f7171fecb7f6 /gdb/gnu-v3-abi.c
parentf993f39ec979dd26e024663a59f481e6d9334bf6 (diff)
downloadgdb-a513d1e8c0893e74ec26dd38dde8f313d7b8b1ba.zip
gdb-a513d1e8c0893e74ec26dd38dde8f313d7b8b1ba.tar.gz
gdb-a513d1e8c0893e74ec26dd38dde8f313d7b8b1ba.tar.bz2
* gnu-v3-abi.c (gnuv3_skip_trampoline): Handle thunk
minimal symbols pointing to function descriptors.
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r--gdb/gnu-v3-abi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 6812c1d..1821f18 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,
+ &current_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)