[PING][PATCH] Fix for prologue processing on PowerPC
Pedro Franco de Carvalho
pedromfc@linux.vnet.ibm.com
Fri Jan 19 19:08:00 GMT 2018
Hello Nikola,
Is that the version you meant to send? That looks like the
same as this one:
https://sourceware.org/ml/gdb-patches/2017-11/msg00207.html
Thanks,
Pedro
Nikola Prica <nikola.prica@rt-rk.com> writes:
> Hi Pedro,
>
> I've just seen that changed version of patch was not attached.
>
> Best regards,
>
> Nikola Prica
> From 3564cd3be620bb39ca615919148fa0d949284d35 Mon Sep 17 00:00:00 2001
> From: Prica <nprica@rt-rk.com>
> Date: Thu, 9 Nov 2017 13:10:48 +0100
> Subject: [PATCH] Fix for prologue processing on PowerPC
>
> One of conditions in skip_prologue() is never visited because it
> expects non shifted `lr_reg`. That condition is supposed to set PC
> offset. When body of this condition is visited PC offset is set and
> there will be no need to look for it in next frames nor to use frame
> unwind directives.
>
> gdb/ChangeLog:
> *rs6000-tdep.c (skip_prologue): Remove shifting for lr_reg
> and assign shifted lr_reg to fdata->lr_register when lr_reg is
> set. If iteration do not hit lim_pc lr_register is set as -1.
> ---
> gdb/rs6000-tdep.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
> index 6c44995..6f05ef5 100644
> --- a/gdb/rs6000-tdep.c
> +++ b/gdb/rs6000-tdep.c
> @@ -1655,9 +1655,12 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
> remember just the first one, but skip over additional
> ones. */
> if (lr_reg == -1)
> - lr_reg = (op & 0x03e00000) >> 21;
> - if (lr_reg == 0)
> - r0_contains_arg = 0;
> + {
> + lr_reg = (op & 0x03e00000);
> + fdata->lr_register = lr_reg >> 21;
> + if (lr_reg == 0)
> + r0_contains_arg = 0;
> + }
> continue;
> }
> else if ((op & 0xfc1fffff) == 0x7c000026)
> @@ -2180,8 +2183,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
> }
> #endif /* 0 */
>
> - if (pc == lim_pc && lr_reg >= 0)
> - fdata->lr_register = lr_reg;
> + if (pc != lim_pc)
> + fdata->lr_register = -1;
>
> fdata->offset = -fdata->offset;
> return last_prologue_pc;
> --
> 2.7.4
More information about the Gdb-patches
mailing list