qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: patches@linaro.org, qemu-devel@nongnu.org,
	Max Filippov <jcmvbkbc@gmail.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>
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	[thread overview]
Message-ID: <5047300.VcNyaJIrmA@thanatos> (raw)
In-Reply-To: <1410545057-14014-1-git-send-email-peter.maydell@linaro.org>

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 <peter.maydell@linaro.org>

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

  parent reply	other threads:[~2014-10-05 21:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 18:04 [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag Peter Maydell
2014-09-16  3:59 ` Max Filippov
2014-09-16  4:15   ` Peter Maydell
2014-09-16  5:16     ` Max Filippov
2014-09-29 18:58       ` Max Filippov
2014-09-16 11:46 ` Edgar E. Iglesias
2014-10-05 21:00 ` Michael Walle [this message]
2014-10-05 21:36   ` Peter Maydell
2014-10-05 21:48     ` Peter Maydell
2014-10-05 22:07       ` Michael Walle
2014-10-06 14:43         ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5047300.VcNyaJIrmA@thanatos \
    --to=michael@walle.cc \
    --cc=aurelien@aurel32.net \
    --cc=edgar.iglesias@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).