qemu-devel
[Top][All Lists]
Advanced

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

Extracting PC information from QEMU/KVM during single-step


From: Steven Raasch
Subject: Extracting PC information from QEMU/KVM during single-step
Date: Wed, 23 Jun 2021 15:14:28 -0500


Hi -

I'm trying to create a hack that will allow me to extract an instruction trace from QEMU/KVM (i386). The KVM part is important (see below).

Background:

I have the output of TCG "-d in_asm" from the beginning of the execution, and I'm comparing the KVM output with that.

What I don't have right is the PC of the instruction that's been executed. The TCG is clearly sane, but the KVM output is not.

My best thought was to extract the PC from kvm_run (run->debug.arch.pc) after the KVM_RUN ioctl, but that doesn't match up. I also tried kvm_vcpu_ioctl() with KVM_GET_REGS, and grabbing the rip from cpu->env.rip. I didn't expect any of these to be exactly right, but I thought they would lead me to something sane.

Using run->debug.arch.pc gives me the right address for the first instruction, but nothing makes sense after that.

Can anyone help me get onto the right track?

Thanks!

-Steve



reply via email to

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