I guess you're mixing some concepts. A PID is a concept from the operating system, not from the hardware, emulated or physical.
What you could do, however, is experiment with user-mode emulation. Check out the QEMU documentation regarding how to use this mode. You could conceivably mess with the operating system scheduler code to emit every context switch to user-land and dump the PID of the current process to the serial port, and have QEMU trap when certain instructions are executed, and then you cross this information yourself. But that just doesn't sound right, specially considering how fast and often context switches happen. OTOH, if you know where in memory the OS stores the current PID, you could make QEMU trap on that instruction and then dump the memory location of interest. HTH, On 4/5/07, Shashidhar Mysore <[EMAIL PROTECTED]> wrote:
Hi, I am trying to add commands to the monitor which can enable or disable tracing in QEMU. As arguments to this command I would like to pass the process ID of the process I wish to trace. Can anybody tell me how to access the process ID from within QEMU? Basically, whenever I see an instruction executing I want to capture more details about the instruction such as the type of instruction, the process ID of the process on behalf of which this instruction is executing (other details I'm interested in is if this is a load or store, memory address, and memory value loaded/stored, etc). Can you please tell me how to figure out these details, especially the process ID. Thanks, -Shashi.