Hi Peter,

On Fri, Sep 12, 2014 at 11:04 AM, Peter Maydell
<peter.mayd...@linaro.org> wrote:
> GDB assumes that watchpoint set via the gdbstub remote protocol will
> behave in the same way as hardware watchpoints for the target. In
> particular, whether the CPU stops with the PC before or after the insn
> which triggers the watchpoint is target dependent. Allow guest CPU
> code to specify which behaviour to use. This fixes a bug where with
> guest CPUs which stop before the accessing insn GDB would manually
> step forward over what it thought was the insn and end up one insn
> further forward than it should be.

I've tested xtensa part and have noticed no difference with or without
this patch:
gdb connected to qemu gdbstub always stops right after the watched instruction.
I guess that without this patch I should have seen gdb stopping not right after
the watched instruction, but one instruction later, right?

> We set this flag for the CPU architectures which set
> gdbarch_have_nonsteppable_watchpoint in gdb 7.7:
> ARM, CRIS, LM32, MIPS and Xtensa.
>
> Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
> ---
> I have tested ARM and confirmed that this patch is needed
> to give correct watchpoint behaviour with a gdb attached to
> our debug stub. I haven't tested the other targets beyond
> compile testing, but I have checked the gdb sources to get
> the list of which targets needed changes.

-- 
Thanks.
-- Max

Reply via email to