]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
ppc: Detect when LR is saved through frame pointer
authorPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Thu, 22 Mar 2018 13:22:45 +0000 (10:22 -0300)
committerPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Thu, 22 Mar 2018 13:22:45 +0000 (10:22 -0300)
commitdd6d677f0b06341dce90d259785c9d513d2e3935
tree86ca0e1d8d81f6d84e1453468e1e376ca4b07f83
parent26d6cec4a9291f154e549fb6f4318ace6cfaa2a5
ppc: Detect when LR is saved through frame pointer

This patch extends rs6000-tdep.c:skip_prologue so that it can detect
when the Link Register is saved using the frame pointer (usually r31)
in adition to the stack pointer (r1).

The frame pointer offset from the frame base is tracked separately
from the stack pointer offset for cases when the frame pointer is not
in synch with the stack pointer at the moment of the LR save.

Previously, "stq" could also be detected as an instruction that saves
LR or CR. Because this was likely unintentional, this patch also
restricts the matches to stw/stwu/std/stdu.

gdb/ChangeLog:

* rs6000-tdep.c (store_insn_p): New function.
(skip_prologue): New variable alloca_reg_offset. Set lr_reg
and cr_reg to their unshifted values. Use store_insn_p to
match LR saves using either R1 or fdata->alloca_reg. Use
store_insn_p to match CR saves. Set alloca_reg_offset
when alloca_reg and framep are set. Remove lr_reg shift
when assigning to fdata->lr_register.
gdb/ChangeLog
gdb/rs6000-tdep.c