qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Saving state on a context switch


From: Paul Brook
Subject: Re: [Qemu-devel] Saving state on a context switch
Date: Wed, 2 May 2007 14:35:40 +0100
User-agent: KMail/1.9.6

On Wednesday 02 May 2007, eady wrote:
> Can anyone think of a way to save and restore an additional cpu state
> variable during a context switch without modifying the target operating
> system? Basically I would like to add a variable to the CPUState
> structure that is saved and restored with the registers.

The short answer is that in general you can't.

Processes and contexts are managed by the host OS, and it is responsible for 
switching state appropriately. Some hardware has features to assist this 
process, but often not enough to reliably identify a particular process.

To do what you want generally requires intimite knowledge of the appropriate 
parts of your OS. Some debuggers are capable of doing this.
There are patches to add scripting support to GDB for this purpose. I don't 
have a URL handy, check the gdb mailing lists.

Paul




reply via email to

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