[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-discuss] inspect an instruction inside the translation block
From: |
Ronen Meir |
Subject: |
Re: [Qemu-discuss] inspect an instruction inside the translation block |
Date: |
Mon, 10 Nov 2014 09:48:06 +0000 |
Hi, and thanks
Started using the singlestep option and I see single instruction per TB indeed.
We are using Qemu in user mode. We have a specific call to a branch that
evolves few LD and store instructions to be used for our system purposes.
Those instructions gets specific address space which is apparently outside the
program stack, (FFFFFFFC, FFFFFF8 and so on). Of course Qemu fails on
segmentation problem and core dump.
I've been trying to fetch the specific instructions just before Qemu translates
the to the machine/host code in order to prevent the segmentation, and to
implement our hooks.
Is it possible?
Thanks
Ronen
-----Original Message-----
From: Peter Maydell [mailto:address@hidden
Sent: Sunday, November 09, 2014 6:41 PM
To: Ronen Meir
Cc: address@hidden
Subject: Re: [Qemu-discuss] inspect an instruction inside the translation block
On 9 November 2014 15:37, Ronen Meir <address@hidden> wrote:
> I'm using Qemu with ARM as target OS.
>
> As far as I understand QEMU executes full translation blocks (TB). I
> would like to isolate and debug a specific instruction within a translation
> block.
That depends on what you mean by "debug". The simplest way to debug guest code
inside QEMU is to attach a gdb to qemu's builtin gdbstub (you'll need one which
understands the ARM architecture; a "multiarch" gdb such as the one shipped in
ubuntu's gdb-multiarch package will do). That will let you set breakpoints,
single step, and so on, as an assembly level debugger.
You can also use QEMU's -singlestep option to force us to put exactly one
instruction in each TB. Whether this is actually any use to you depends rather
on what you're trying to do; it's probably only really helpful if you're trying
to debug QEMU itself, in which case you'll probably also want to use our -d
option to enable various kinds of debug logging (including disassembly of guest
instructions in and TCG ops and host instructions out).
thanks
-- PMM