Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2004 11:45:20 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 51720 for review
Message-ID:  <200404251845.i3PIjKE3027189@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=51720

Change 51720 by marcel@marcel_sledge on 2004/04/25 11:44:19

	MFi386.

Affected files ...

.. //depot/projects/gdb/sys/amd64/amd64/trap.c#7 edit

Differences ...

==== //depot/projects/gdb/sys/amd64/amd64/trap.c#7 (text+ko) ====

@@ -46,7 +46,6 @@
 
 #include "opt_clock.h"
 #include "opt_cpu.h"
-#include "opt_ddb.h"
 #include "opt_isa.h"
 #include "opt_ktrace.h"
 
@@ -56,6 +55,7 @@
 #include <sys/proc.h>
 #include <sys/pioctl.h>
 #include <sys/ptrace.h>
+#include <sys/kdb.h>
 #include <sys/kernel.h>
 #include <sys/ktr.h>
 #include <sys/lock.h>
@@ -88,8 +88,6 @@
 #endif
 #include <machine/tss.h>
 
-#include <ddb/ddb.h>
-
 extern void trap(struct trapframe frame);
 extern void syscall(struct trapframe frame);
 
@@ -130,10 +128,10 @@
 	"machine check trap",			/* 28 T_MCHK */
 };
 
-#ifdef DDB
-static int ddb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, ddb_on_nmi, CTLFLAG_RW,
-	&ddb_on_nmi, 0, "Go to DDB on NMI");
+#ifdef KDB
+static int kdb_on_nmi = 1;
+SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
+	&kdb_on_nmi, 0, "Go to KDB on NMI");
 #endif
 static int panic_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
@@ -167,15 +165,15 @@
 	atomic_add_int(&cnt.v_trap, 1);
 	type = frame.tf_trapno;
 
-#ifdef DDB
-	if (db_active) {
-		vm_offset_t eva;
-		eva = (type == T_PAGEFLT ? frame.tf_addr : 0);
-		trap_fatal(&frame, eva);
+#ifdef KDB
+	if (kdb_active && type == T_PAGEFLT) {
+		kdb_trap(type, 0, &frame);
 		goto out;
 	}
 #endif
 
+	td->td_last_frame = &frame;
+
 	if ((frame.tf_rflags & PSL_I) == 0) {
 		/*
 		 * Buggy application or kernel code has disabled
@@ -288,7 +286,7 @@
 				 * NMI can be hooked up to a pushbutton
 				 * for debugging.
 				 */
-				if (ddb_on_nmi) {
+				if (kdb_on_nmi) {
 					printf ("NMI ... going to debugger\n");
 					kdb_trap (type, 0, &frame);
 				}
@@ -419,12 +417,12 @@
 			 */
 		case T_BPTFLT:
 			/*
-			 * If DDB is enabled, let it handle the debugger trap.
+			 * If KDB is enabled, let it handle the debugger trap.
 			 * Otherwise, debugger traps "can't happen".
 			 */
 #ifdef KDB
 			/* XXX Giant */
-			if (kdb_trap (type, 0, &frame))
+			if (kdb_trap(type, 0, &frame))
 				goto out;
 #endif
 			break;
@@ -439,9 +437,9 @@
 				 * NMI can be hooked up to a pushbutton
 				 * for debugging.
 				 */
-				if (ddb_on_nmi) {
+				if (kdb_on_nmi) {
 					printf ("NMI ... going to debugger\n");
-					kdb_trap (type, 0, &frame);
+					kdb_trap(type, 0, &frame);
 				}
 #endif /* KDB */
 				goto out;
@@ -630,7 +628,7 @@
 	}
 
 #ifdef KDB
-	if ((debugger_on_panic || db_active) && kdb_trap(type, 0, frame))
+	if (kdb_trap(type, 0, frame))
 		return;
 #endif
 	printf("trap number		= %d\n", type);
@@ -699,6 +697,7 @@
 	regcnt = 6;
 	sticks = td->td_sticks;
 	td->td_frame = &frame;
+	td->td_last_frame = &frame;
 	if (td->td_ucred != p->p_ucred) 
 		cred_update_thread(td);
 	if (p->p_flag & P_SA)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404251845.i3PIjKE3027189>