From 2d8b87461880a28413751515a0b56b29bf14efad Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 21 Aug 2001 20:09:05 +0000 Subject: Add a hook to mi_switch() to abort via db_error() if we attempt to perform a context switch from DDB. Consulting from: bde --- sys/kern/kern_synch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sys') diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 6a20e10..e39ee45 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -39,6 +39,7 @@ * $FreeBSD$ */ +#include "opt_ddb.h" #include "opt_ktrace.h" #include @@ -58,6 +59,9 @@ #include #include #include +#ifdef DDB +#include +#endif #ifdef KTRACE #include #include @@ -664,6 +668,14 @@ mi_switch() (int64_t)1000000; } +#ifdef DDB + /* + * Don't perform context switches from the debugger. + */ + if (db_active) + db_error("Context switches not allowed in the debugger."); +#endif + #if 0 /* * Check if the process exceeds its cpu resource allocation. -- cgit v1.1