From: Daniel Jacobowitz <dan@codesourcery.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org, rearnsha@arm.com
Subject: Re: [rfa] Fix software-watchpoint failures by adding epilogue detection
Date: Tue, 28 Sep 2010 20:23:00 -0000 [thread overview]
Message-ID: <20100928151529.GG6886@caradoc.them.org> (raw)
In-Reply-To: <201009241239.o8OCd52U013473@d12av02.megacenter.de.ibm.com>
On Fri, Sep 24, 2010 at 02:39:05PM +0200, Ulrich Weigand wrote:
> 1. Some epilogue sequences accepted by your patch were not accepted by mine:
> - My patch only accepted "bx lr" as return, while yours accepts any "bx".
> - I had a typo in one of the instruction opcodes.
>
> 2. Some epilogue sequences accepted by my patch were not accepted by yours:
> - I'm allowing "mov sp, r7" and "vldm" instructions, as well as certain
> additional cases of "ldm.w".
These all sound good.
> - I'm accepting more diverse sequences due to forward-scanning for multiple
> instructions, and not requiring backward-scanning.
This I'm worried about. From my patch:
+ /* We are in the epilogue if the previous instruction was a stack
+ adjustment and the next instruction is a possible return (bx, mov
+ pc, or pop).
This is definitely an epilogue:
pop { r4, r5, r6, lr }
bx lr
This could be an epilogue, but it could also be an indirect call:
bx lr
If it's an indirect call there would be a mov lr, pc before it.
If it's an indirect tail call, then it's an epilogue, and the return
address won't be saved.
If there's no stack adjustment, then gdbarch_in_function_epilogue_p
does not need to return 1; the predicate really means "we can not
check for watchpoints because the frame might be in an inconsistent
state".
Is it safe for this predicate to return 1 around something that is not
an epilogue?
Given that definition of the predicate, the backwards scan is
appropriate; without a backwards scan, we can only answer "is there an
epilogue after this point", not "are we already inside an epilogue".
Of course, if it turns out harmless to return false positives... I'm
not sure.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2010-09-28 15:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-22 19:20 Ulrich Weigand
2010-09-22 20:01 ` Daniel Jacobowitz
2010-09-23 16:13 ` Ulrich Weigand
2010-09-24 16:11 ` Ulrich Weigand
2010-09-28 20:23 ` Daniel Jacobowitz [this message]
2010-09-28 21:47 ` Ulrich Weigand
2010-09-28 21:49 ` Daniel Jacobowitz
2010-09-29 15:24 ` Richard Earnshaw
2010-10-07 16:12 ` [rfa, v3] Fix software-watchpoint failures on ARM " Ulrich Weigand
2010-10-08 13:01 ` Richard Earnshaw
2010-10-08 13:27 ` Ulrich Weigand
2010-09-29 14:43 ` [rfa] Fix software-watchpoint failures " Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100928151529.GG6886@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=rearnsha@arm.com \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox