qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoin


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag
Date: Sun, 5 Oct 2014 22:36:54 +0100

On 5 October 2014 22:00, Michael Walle <address@hidden> wrote:
> 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?

No, gdb wants execution to stop with the PC just after the
instruction which issued the memory access, with whatever
effects the instruction had having already taken place.
So (2) is correct. (I think nicer UI would indeed be to
stop at (1) but you can't get that effect on CPUs like
x86 which only stop after the wp insn has executed, and
they'd rather be consistent.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]