This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. 6b65d1b6b3bb69051e32537cddf92baa22513cbd
- From: qiyao at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 28 Aug 2014 07:26:30 -0000
- Subject: gdb and binutils branch master updated. 6b65d1b6b3bb69051e32537cddf92baa22513cbd
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 6b65d1b6b3bb69051e32537cddf92baa22513cbd (commit)
from a1b34d156a85f8c93af66a3677e75a132bfcc54a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b65d1b6b3bb69051e32537cddf92baa22513cbd
commit 6b65d1b6b3bb69051e32537cddf92baa22513cbd
Author: Yao Qi <yao@codesourcery.com>
Date: Fri Aug 1 11:26:16 2014 +0800
arm software watchpoint: return to epilogue
Hi,
This patch is to handle a software watchpoint case that program returns
to caller's epilogue, and it causes the fail in thumb mode,
finish^M
Run till exit from #0 func () at gdb/testsuite/gdb.base/watchpoint-cond-gone.c:26^M
0x000001f6 in jumper ()^M
(gdb) FAIL: gdb.base/watchpoint-cond-gone.exp: Catch the no longer valid watchpoint
In the test, jumper calls func, and programs returns from func to
jumper's epilogue, IOW, the branch instruction is the last instruction
of jumper's function body.
jumper:
.....
0x000001f2 <+10>: bl 0x200 [1] <---- indirect call to func
0x000001f6 <+14>: mov sp, r7 [2] <---- start of the epilogue
0x000001f8 <+16>: add sp, #8
0x000001fa <+18>: pop {r7}
0x000001fc <+20>: pop {r0}
0x000001fe <+22>: bx r0
When the inferior returns from func back to jumper, it is expected
that an expression of a software watchpoint becomes out-of-scope.
GDB validates the expression by checking the corresponding frame,
but this check is guarded by gdbarch_in_function_epilogue_p. See
breakpoint.c:watchpoint_check.
It doesn't work in this case, because program returns from func's
epilogue back to jumper's epilogue [2], GDB thinks the program is
still within the epilogue, but in fact it goes to a different one.
When PC points at [2], the sp-restore instruction is to be
executed, so the stack frame isn't destroyed yet and we can still
use the frame mechanism reliably.
Note that when PC points to the first instruction of restoring SP,
it is part of epilogue, but we still return zero. When goes to
the next instruction, the backward scan will still match the
epilogue sequence correctly. The reason for doing this is to
handle the "return-to-epilogue" case.
What this patch does is to restrict the epilogue matching that let
GDB think the first SP restore instruction isn't part of the epilogue,
and fall back to use frame mechanism. We set 'found_stack_adjust'
zero before backward scan, and we've done this for arm mode
counterpart (arm_in_function_epilogue_p) too.
The patch is tested in arm-none-eabi and arm-none-linux-gnueabi with
various multilibs. OK to apply?
gdb:
2014-08-28 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (thumb_in_function_epilogue_p): Don't set
found_stack_adjust in forward scan. Remove condition check
on found_stack_adjust which is always true. Indent the code.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 6 ++++++
gdb/arm-tdep.c | 42 ++++++++++++++++++------------------------
2 files changed, 24 insertions(+), 24 deletions(-)
hooks/post-receive
--
gdb and binutils