This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: question about ARM watchpoints
- From: Pedro Alves <palves at redhat dot com>
- To: Gareth McMullin <gareth at blacksphere dot co dot nz>, Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 05 Sep 2014 01:28:32 +0100
- Subject: Re: question about ARM watchpoints
- Authentication-results: sourceware.org; auth=none
- References: <20140901085743 dot GG4981 at adacore dot com> <CAL8qUbqTyBAkrXnN=DxmL5d3h5nwnfv=dO-vDdqxB+kVrZNzSQ at mail dot gmail dot com>
On 09/04/2014 11:36 PM, Gareth McMullin wrote:
> Hi
>
> On Mon, Sep 1, 2014 at 8:57 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> Everything works pretty well, except that we noticed that GDB stops
>> 2 instructions after the variable update, rather than at the next
>> instruction.
>
> I get the same behaviour on the Black Magic Probe on ARMv7-M.
> The DWT halts the core on the instruction after the address match.
>
>> The question then becomes: Is QEMU behaving correctly, in which
>> case we should be modifying GDB, or is QEMU signaling GDB too
>> late, in which case we should be fixing QEMU?
>
> What QEMU is doing is the same as the hardware DWT block, so I'd
> say this is the correct behaviour. The fix should be in GDB. Working
> around this in QEMU would leave all hardware based implementations
> broken.
So sounds like this line should be skipped on ARMv7-M:
arm-tdep.c: set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
Could you try removing it?
But then I wonder why we never heard of this before. Are there
ARMv7-M's that behave differently? And what about ARMv6-M ?
Thanks,
Pedro Alves