This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Greta Yorsh <Greta dot Yorsh at arm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 25 Jun 2012 13:15:42 +0100
- Subject: Re: [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p
- References: <001d01cd52ca$19f65d60$4de31820$@Yorsh@arm.com>
On 25/06/12 13:00, Greta Yorsh wrote:
> This patch is related to a recent change in the way gcc generates function
> epilogues for arm targets (since gcc trunk r188745):
> http://gcc.gnu.org/ml/gcc-patches/2012-05/msg02071.html
>
> The function arm_in_function_epilogue_p does not recognize POP with a single
> register as a stack adjustment in arm mode.
> It causes two test new failures in gdb testsuite:
> FAIL: gdb.base/watch-cond.exp: watchpoint with local expression, local
> condition evaluates in correct frame
> FAIL: gdb.mi/mi2-watch.exp: hw: watchpoint trigger (stopped at wrong place)
>
> The reason is that in arm mode the encoding of POP with single register is
> different from the encoding of POP with multiple registers. The attached
> patch adds the missing pattern to arm_in_function_epilogue_p.
>
> Thanks,
> Greta
>
> ChangeLog
>
> gdb/
>
> 2012-06-25 Greta Yorsh <Greta.Yorsh@arm.com>
>
> * arm-tdep.c (arm_in_function_epilogue_p): Recognize POP
> with a single register as a stack adjustment in arm mode.
>
>
> gdb-pop-one-reg.patch.txt
>
>
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index df5dea7..568ace5 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -3217,6 +3217,9 @@ arm_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
> else if ((insn & 0x0fff0000) == 0x08bd0000)
> /* POP (LDMIA). */
> found_stack_adjust = 1;
> + else if ((insn & 0x0fff0000) == 0x049d0000)
> + /* POP of a single register. */
> + found_stack_adjust = 1;
> }
>
> if (found_stack_adjust)
>
OK.
R.