Opened 5 years ago
#19672 new defect
Single step emulation bug
Reported by: | B-O | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 6.1.10 |
Keywords: | Cc: | ||
Guest type: | all | Host type: | Mac OS X |
Description
Single stepping code in a guest VM doesn't work correctly with I/O instructions.
I first noticed the problem in the built in kernel debugger in my OS. By further examination I also noted that the problem could be reproduced in Windows XP with both the 16-bit command line debugger and an a free 32-bit version of the same. Thus the problem is general.
The problem was detected with single stepping the out instruction. The instruction following the out instruction will also be single stepped, causing the guest VMs exception #1 to point to the wrong instruction.
out 80,al call Foo
will point to first instruction in Foo instead of the call Foo line.
As RDTSC instruction has been fixed in a similar situation, I assume you have not applied the fix on all privileged instructions like IN, OUT, INT nn etc. The VM emulator should check the TF flag in the instruction emulator and emulate exception #1 in addition if it's set.
I have included the VBOXBUG.COM file that reproduce the problem in Windows XP debug command.
debug VBOXBUG.COM will load the program.
Write U for disassembling and you see what it does. For every out instruction we trace into the subroutine that is called after the OUT instruction instead of stopping at the CALL instruction following it.
You use the T (TRACE INTO)command for single stepping. Perhaps P (TRACE OVER) generates the same problem.
Best regards,
B-O Bergman PQURE Technology
application for reproducing bug