|
From: Jeremy F. <je...@go...> - 2005-02-04 22:56:49
|
On Fri, 2005-02-04 at 20:38 +0000, Chris January wrote: > Sorry, maybe I'm not looking at your patch correctly but I can't see how the > VCPU state is flushed out before the exception is generated. Could you > explain please? As I understand it the VCPU state is only flushed after the > exception has occurred, the kernel has queued the SIGTRAP signal, Valgrind > has received the signal and longjmp'ed out of the scheduler. Any external > program monitoring the program looking for traps, for example, will see the > wrong instruction pointer, even if they look in the baseBlock/VG_(threads) > structure instead of the real regs. EIP in the ThreadState (previously baseBlock) is always up to date, because its updated after every instruction. If the INT never completes (which it won't), EIP in the ThreadState will be left pointing to the client instruction which triggered the exception. The other register state may be still wrong; I think vg_from_ucode might defer flushing it until the last moment, which is after the call to the helper. That just means that you need to run with --single-step=yes, like you do with any other program which requires precise exceptions. J |