This is the mail archive of the
mailing list for the GDB project.
Re: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint
- From: Pedro Alves <palves at redhat dot com>
- To: Peter Maydell <peter dot maydell at linaro dot org>
- Cc: Will Deacon <will dot deacon at arm dot com>, Joel Brobecker <brobecker at adacore dot com>, Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, Terry Guo <Terry dot Guo at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, "lgustavo at codesourcery dot com" <lgustavo at codesourcery dot com>, "yao at codesourcery dot com" <yao at codesourcery dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "Gareth, McMullin" <gareth at blacksphere dot co dot nz>
- Date: Tue, 30 Sep 2014 11:37:53 +0100
- Subject: Re: [RFA/commit] arm-tdep.c: Do not single-step after hitting a watchpoint
- Authentication-results: sourceware.org; auth=none
- References: <CAFEAcA_0C+UqGwM39A4EQCQLg59fNbJ2du8rhrt++Q-pdE9rgQ at mail dot gmail dot com> <5429D9FC dot 6000509 at redhat dot com> <CAFEAcA9Dx5GE6QCktvbQF8sL1MsRxE5BmPNruSw4FsW9VyD_2w at mail dot gmail dot com> <542A72F9 dot 5090203 at redhat dot com> <20140930091824 dot GE8075 at arm dot com> <542A80D9 dot 20104 at redhat dot com> <CAFEAcA9H5i_63aBZVqk+GZMrBZGhXgN5avKt7O7uyGSxiEkv_A at mail dot gmail dot com>
On 09/30/2014 11:17 AM, Peter Maydell wrote:
> On 30 September 2014 11:07, Pedro Alves <firstname.lastname@example.org> wrote:
>> WFAR - Watchpoint Fault Address Register
>> The WFAR is updated to indicate the address of the instruction that
>> accessed the watchpointed address:
>> - the address of the instruction + 8 in ARM state
>> - the address of the instruction + 4 in ThumbÂ state
>> What wasn't clear to me was whether this meant that the
>> instruction at the address of the instruction, and
>> at the the address of the instruction +4/+2 (ARM/Thumb) had
>> executed completely or not. It's my understanding now that,
>> yes, both the instruction that caused the watchpoint and the
>> instruction after that one have already been executed.
> No, you are misinterpreting this. The WFAR records
> the address of the offending instruction + an offset
> which you have to correct for. The offset does *not*
> have any relation to how many further instructions
> the CPU has executed after the offending instruction,
> which could be none, one, two or ten. Asynchronous
> watchpoints are *asynchronous*, which means there
> is no timing guarantee about how soon the CPU will
> notice that one has fired and stop executing insns.
> The only guarantee you get in v7 is that you'll get
> the watchpoint before any exception that might be
> caused by a following instruction.
OK. It's clear now.