question about ARM watchpoints

Pedro Alves palves@redhat.com
Fri Sep 5 00:28:00 GMT 2014


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



More information about the Gdb mailing list