]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix single-stepping of instructions emulated by vm86.
authorbde <bde@FreeBSD.org>
Thu, 8 Sep 2016 14:43:39 +0000 (14:43 +0000)
committerbde <bde@FreeBSD.org>
Thu, 8 Sep 2016 14:43:39 +0000 (14:43 +0000)
commit7e070adea9e99bce9599f9459894a1c3c72bd226
treecf780e520fa830529d2de11dd1a18b4506731c4d
parent65fddebdb81042a46070e8d16e9ced57c9fd6653
Fix single-stepping of instructions emulated by vm86.

In vm86.c, fix 2 (rarely used) cases where the return code lost the
single-step indicator.  While here, fix 2 misspellings of PSL_T as
PSL_TF (TF is the CPU manufacturer's spelling, but we use T).

In trap.c, turn T_PROTFLT and T_STKFLT into T_TRCTRAP if
vm86_emulate() asked for this (it does this when the instruction is
being traced and was successully emulated).  In the kernel case, we
used to deliver the trap as SIGTRAP to the process, where it always
terminated the process; now we deliver the trap as T_TRCTRAP to kdb,
where it normally gives single-stepping.  In the user case, the only
difference is that we now clear PSL_T and initialize ucode properly.

Reviewed by: kib
sys/i386/i386/trap.c
sys/i386/i386/vm86.c