From 15d4e175980e20d0034085a2dc3bf8c0db59f405 Mon Sep 17 00:00:00 2001 From: mycroft Date: Thu, 18 Apr 1996 20:36:35 +0000 Subject: [PATCH] Send a trace trap only if the trace flag is set at the *beginning* of the emulated instruction. --- sys/arch/i386/i386/vm86.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arch/i386/i386/vm86.c b/sys/arch/i386/i386/vm86.c index ed5f71809ae7..c7e26f16e6cc 100644 --- a/sys/arch/i386/i386/vm86.c +++ b/sys/arch/i386/i386/vm86.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm86.c,v 1.10 1996/04/18 19:58:09 mycroft Exp $ */ +/* $NetBSD: vm86.c,v 1.11 1996/04/18 20:36:35 mycroft Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -285,6 +285,7 @@ vm86_gpfault(p, type) int type; { struct trapframe *tf = p->p_md.md_regs; + int trace; /* * we want to fetch some stuff from the current user virtual * address space for checking. remember that the frame's @@ -298,6 +299,8 @@ vm86_gpfault(p, type) ss = SS(tf) << 4; sp = SP(tf); + trace = tf->tf_eflags & PSL_T; + /* * For most of these, we must set all the registers before calling * macros/functions which might do a vm86_return. @@ -367,7 +370,7 @@ vm86_gpfault(p, type) goto bad; } - if (tf->tf_eflags & PSL_T) + if (trace) trapsignal(p, SIGTRAP, T_TRCTRAP); return;