Apply by doing:
	cd /usr/src/sys/arch/i386/i386
	patch < trctrap.patch

build a new kernel, ie.
	cd /usr/src/sys/arch/i386/conf
	config GENERIC
	cd ../compile/GENERIC
	make
	mv /bsd /bsd.1
	cp bsd /bsd
	reboot

Index: locore.s
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/locore.s,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- locore.s	1998/09/06 20:09:58	1.45
+++ locore.s	1999/02/12 19:40:12	1.46
@@ -2067,6 +2067,7 @@
 	popfl
 	pushl	$7		# size of instruction for restart
 	jmp	syscall1
+IDTVEC(osyscall_end)
 
 /*
  * Trap gate entry for syscall
Index: trap.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/trap.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- trap.c	1999/02/10 08:07:20	1.28
+++ trap.c	1999/02/12 19:40:12	1.29
@@ -220,6 +220,26 @@
 
 	switch (type) {
 
+	/* trace trap */
+	case T_TRCTRAP: {
+#ifdef DDB
+		/* Make sure nobody is single stepping into kernel land.
+		 * The syscall has to turn off the trace bit itself.  The
+		 * easiest way, is to simply not call the debugger, until
+		 * we are through the problematic "osyscall" stub.  This
+		 * is a hack, but it does seem to work.
+		 */
+		extern int Xosyscall, Xosyscall_end;
+
+		if (frame.tf_eip >= (int)&Xosyscall &&
+		    frame.tf_eip <= (int)&Xosyscall_end)
+			return;
+#else
+		return; /* Just return if no DDB */
+#endif
+	}
+	/* FALLTHROUGH */
+
 	default:
 	we_re_toast:
 #ifdef DDB
@@ -456,13 +476,6 @@
 		trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv);
 		break;
 	}
-
-#ifndef DDB
-	/* XXX need to deal with this when DDB is present, too */
-	case T_TRCTRAP:	/* kernel trace trap; someone single stepping lcall's */
-			/* syscall has to turn off the trace bit itself */
-		return;
-#endif
 
 	case T_BPTFLT|T_USER:		/* bpt instruction fault */
 		sv.sival_int = rcr2();
