qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] API for single stepping an emulated CPU


From: Wacha Gábor
Subject: Re: [Qemu-devel] API for single stepping an emulated CPU
Date: Fri, 4 May 2012 07:46:35 +0200

Yes, it seemed to be a good choice to look into, thank you.

But my problem is:
As I've seen, the single step mode generates a debug exception (EXCL_DEBUG) after every iteration of the main loop, which will make a change in the vm state.
I can register a vm change state handler in my peripheral and wait until my external debugger hardware enables the program continuation.
I did exactly this (like the gdb stub), but without success. It seems that my state change handler is never called.
It is registered in the init function of the peripheral. For now it should only print out a debug message. When I run qemu-system-arm with the -single-step option I can not see that particular debug message on the console (but my other messages are there), so I think my function is not called.

Am I missing something?

And I have another question: if I call a blocking function in the state change handler, will it block the CPU (as it seems logical to me) or it is in another thread?

Regards,
Gabor

2012/5/2 陳韋任 <address@hidden>
> I am designing a virtual peripheral for Qemu, for which I need to single step
> through the program on the emulated CPU (my peripheral will be some kind of a
> debugger). My question is: is there an API to execute exactly one instruction
> in Qemu? I've already found the *_pause and *_resume functions, but they are -
> as far as I know - not applicable for my task.

 Just a quick reply. QEMU system mode provides "-singlestep" option. Maybe you
can start from there, see how the singlestep is done.

Regards,
chenwj

--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj


reply via email to

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