X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fppc64-tdep.c;h=b7357e3c43af98a85bedf977b5a9360957406282;hb=a14d1f4dfc08edc8fe92b17b36a55d89203fb89f;hp=66d7b2362e1487326ff139a2fe6f0ae1da941ddc;hpb=cf90fd9a07e8998540bf74f293d348a6653ac120;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c index 66d7b2362e..b7357e3c43 100644 --- a/gdb/ppc64-tdep.c +++ b/gdb/ppc64-tdep.c @@ -1,6 +1,6 @@ /* Common target-dependent code for ppc64 GDB, the GNU debugger. - Copyright (C) 1986-2015 Free Software Foundation, Inc. + Copyright (C) 1986-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -449,10 +449,13 @@ ppc64_standard_linkage4_target (struct frame_info *frame, /* Given that we've begun executing a call trampoline at PC, return - the entry point of the function the trampoline will go to. */ + the entry point of the function the trampoline will go to. -CORE_ADDR -ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) + When the execution direction is EXEC_REVERSE, scan backward to + check whether we are in the middle of a PLT stub. */ + +static CORE_ADDR +ppc64_skip_trampoline_code_1 (struct frame_info *frame, CORE_ADDR pc) { #define MAX(a,b) ((a) > (b) ? (a) : (b)) unsigned int insns[MAX (MAX (MAX (ARRAY_SIZE (ppc64_standard_linkage1), @@ -527,6 +530,20 @@ ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) return 0; } +/* Wrapper of ppc64_skip_trampoline_code_1 checking also + ppc_elfv2_skip_entrypoint. */ + +CORE_ADDR +ppc64_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) +{ + struct gdbarch *gdbarch = get_frame_arch (frame); + + pc = ppc64_skip_trampoline_code_1 (frame, pc); + if (pc != 0 && gdbarch_skip_entrypoint_p (gdbarch)) + pc = gdbarch_skip_entrypoint (gdbarch, pc); + return pc; +} + /* Support for convert_from_func_ptr_addr (ARCH, ADDR, TARG) on PPC64 GNU/Linux.