* [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p
@ 2012-06-25 12:01 Greta Yorsh
2012-06-25 12:16 ` Richard Earnshaw
0 siblings, 1 reply; 2+ messages in thread
From: Greta Yorsh @ 2012-06-25 12:01 UTC (permalink / raw)
To: gdb-patches; +Cc: Richard Earnshaw
[-- Attachment #1: Type: text/plain, Size: 975 bytes --]
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.
[-- Attachment #2: gdb-pop-one-reg.patch.txt --]
[-- Type: text/plain, Size: 467 bytes --]
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p
2012-06-25 12:01 [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p Greta Yorsh
@ 2012-06-25 12:16 ` Richard Earnshaw
0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2012-06-25 12:16 UTC (permalink / raw)
To: Greta Yorsh; +Cc: gdb-patches
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-25 12:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 12:01 [Patch, ARM] Add POP of single register to arm_in_function_epilogue_p Greta Yorsh
2012-06-25 12:16 ` Richard Earnshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox