Skip to contentSkip to conversation

Determine simulated pc during an exception

Qemu-devel eady 2 participants 3 messages Apr 14, 2007 – Apr 15, 2007

lore
Share & tools
lore

eady

author
#0 lore raw

In the QEMU internals docs under exception support the following is stated... "The simulated program counter is found by retranslating the corresponding basic block and by looking where the host program counter was at the exception point."

Can anyone point me to the place in the code where the simulated program counter is determined after an exception?

Thanks

#1 lore raw
Quoted 2 lines

Can anyone point me to the place in the code where the simulated program counter is determined after an exception?

cpu_restore_state

Paul

author
#2 lore raw

Thanks Paul for the reply, I don't see how this function is called though by the exception handler. The way I understand it is that an exception is raised via raise_interrupt(exception_index, 0, 0, 0); in helper.c which in turn calls raise_interrupt() that sends the control flow back to the main execution loop via a longjmp and then do_interrupt() is called from there. Where am I not making the connection?

Thanks,
Nuri

Quoted 10 lines · Paul Brook
Quoted 3 lines

Can anyone point me to the place in the code where the simulated program counter is determined after an exception?

cpu_restore_state

Paul