diff options
author | bde <bde@FreeBSD.org> | 2002-01-10 11:49:55 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2002-01-10 11:49:55 +0000 |
commit | 4bc93bce9562a8b9fef41567055aa1f18006ced3 (patch) | |
tree | 7871d96b3c7a4dfee1d7378681c22b9b12eb2708 /sys/pc98 | |
parent | f267ba5cc73797843de3904ea9c79682ad9674ad (diff) | |
download | FreeBSD-src-4bc93bce9562a8b9fef41567055aa1f18006ced3.zip FreeBSD-src-4bc93bce9562a8b9fef41567055aa1f18006ced3.tar.gz |
Clear the single-step flag for signal handlers. This fixes bogus trace
traps on the first instruction of signal handlers.
In trap.c:syscall(), fake a trace trap if the single-step flag was set
on entry to the kernel, not if it will be set on exit from the kernel.
This fixes bogus trace traps after the last instruction of signal handlers.
gdb-4.18 (the version in FreeBSD) still has problems with the program in
the PR. These seem to be due to bugs in gdb and not in FreeBSD, and are
fixed in gdb-5.1 (the distribution version).
PR: 33262
Tested by: k Macy <kip_macy@yahoo.com>
MFC after: 1 day
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/i386/machdep.c | 10 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 94f7ec3..3ba1370 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -414,7 +414,7 @@ osendsig(catcher, sig, mask, code) (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); /* See sendsig() for comments. */ - tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP); + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); } /* Copy the sigframe out to the user's stack. */ @@ -430,6 +430,7 @@ osendsig(catcher, sig, mask, code) regs->tf_esp = (int)fp; regs->tf_eip = PS_STRINGS - szosigcode; + regs->tf_eflags &= ~PSL_T; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; @@ -558,17 +559,13 @@ sendsig(catcher, sig, mask, code) (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); /* - * We should never have PSL_T set when returning from vm86 - * mode. It may be set here if we deliver a signal before - * getting to vm86 mode, so turn it off. - * * Clear PSL_NT to inhibit T_TSSFLT faults on return from * syscalls made by the signal handler. This just avoids * wasting time for our lazy fixup of such faults. PSL_NT * does nothing in vm86 mode, but vm86 programs can set it * almost legitimately in probes for old cpu types. */ - tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP); + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); } /* Copy the sigframe out to the user's stack. */ @@ -584,6 +581,7 @@ sendsig(catcher, sig, mask, code) regs->tf_esp = (int)sfp; regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eflags &= ~PSL_T; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 94f7ec3..3ba1370 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -414,7 +414,7 @@ osendsig(catcher, sig, mask, code) (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); /* See sendsig() for comments. */ - tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP); + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); } /* Copy the sigframe out to the user's stack. */ @@ -430,6 +430,7 @@ osendsig(catcher, sig, mask, code) regs->tf_esp = (int)fp; regs->tf_eip = PS_STRINGS - szosigcode; + regs->tf_eflags &= ~PSL_T; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; @@ -558,17 +559,13 @@ sendsig(catcher, sig, mask, code) (vm86->vm86_eflags & (PSL_VIF | PSL_VIP)); /* - * We should never have PSL_T set when returning from vm86 - * mode. It may be set here if we deliver a signal before - * getting to vm86 mode, so turn it off. - * * Clear PSL_NT to inhibit T_TSSFLT faults on return from * syscalls made by the signal handler. This just avoids * wasting time for our lazy fixup of such faults. PSL_NT * does nothing in vm86 mode, but vm86 programs can set it * almost legitimately in probes for old cpu types. */ - tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_T | PSL_VIF | PSL_VIP); + tf->tf_eflags &= ~(PSL_VM | PSL_NT | PSL_VIF | PSL_VIP); } /* Copy the sigframe out to the user's stack. */ @@ -584,6 +581,7 @@ sendsig(catcher, sig, mask, code) regs->tf_esp = (int)sfp; regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eflags &= ~PSL_T; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel; |