[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoin
From: |
Michael Walle |
Subject: |
Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag |
Date: |
Sun, 05 Oct 2014 23:00:43 +0200 |
User-agent: |
KMail/4.14.1 (Linux/3.16-2-amd64; KDE/4.14.1; x86_64; ; ) |
Am Freitag, 12. September 2014, 19:04:17 schrieb Peter Maydell:
> 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.
>
> 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 <address@hidden>
Hi Peter,
i've tested your patch on the lm32 target.
My test program was like the following:
mvhi r1, hi(0x10000000)
ori r1, r1, lo(0x10000000)
nop
nop
nop
nop
sw (r1+0), r0 ; (1) store some value to 0x10000000
nop ; (2)
nop ; (3)
nop
nop
1: bi 1b ; loop forever
I can confirm that your patch makes qemu stop one instruction earlier. Without
your patch the program is stopped at (3). With your patch applied the program
is stopped at (2). But I guess the correct point to stop is (1), right?
I think there is still some mistake in the lm32 target code in qemu. I'll look
into it soon.
--
-michael
- Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag,
Michael Walle <=