All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: David Munday <cromom@soe.ucsc.edu>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] target ARM PC increment
Date: Tue, 3 Jul 2012 08:42:03 +0100	[thread overview]
Message-ID: <CAFEAcA-PUeT9v4bj3Q9gQvh1=HWY6KcgfMSVTx0mZ-vtNfdSGA@mail.gmail.com> (raw)
In-Reply-To: <CAPPLFzN=Zx6V3DRoDTjwzuhTbv=0uSi1RAfbLPFQJQBQ1sYosA@mail.gmail.com>

On 3 July 2012 01:53, David Munday <cromom@soe.ucsc.edu> wrote:
> I'm developing with QEMU to run arm binaries. Right now I can't tell if the
> Thumb32 vmul.f64 instruction encoded(ee25 7b07) is executing or not. I would
> like to see where QEMU increments the PC so as to see if this instruction is
> getting skipped or to trace it's behavior.
>
> I've looked extensively through cpu-exec.c and target-arm/cpu.h but have yet
> to find where I can print the PC of each instruction executed.

You can't, at least not easily. The PC is only updated:
 * at the end of a basic block
 * before certain operations that require register state to be correct
 * in the exception handling path for things like loads which aborted

Having an explicit "add 4 to PC" after each instruction would be a lot
of overhead in the common case, which is why we don't do it that way.

The easiest way to check if the instruction is actually doing something
is probably to use qemu's built in debug stub and connect an ARM gdb
to it. Then you can single step in the gdb and look at register values
before and after.

If you want to check whether we're actually generating code of some
kind for the instruction, then run QEMU under an x86 gdb and put a
breakpoint on disas_thumb_insn(), conditional on s->pc being the
location of the insn you're interested in. Then step through...
Or use the '-d' options to trace incoming and outgoing assembly.

(NB: I'm assuming you're using at least QEMU1.0 here. Older QEMU
had a number of problems with the VFP and Neon emulation; using
them is likely to be a waste of your time.)

-- PMM

      reply	other threads:[~2012-07-03  7:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03  0:53 [Qemu-devel] target ARM PC increment David Munday
2012-07-03  7:42 ` Peter Maydell [this message]

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='CAFEAcA-PUeT9v4bj3Q9gQvh1=HWY6KcgfMSVTx0mZ-vtNfdSGA@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=cromom@soe.ucsc.edu \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.