From 161778121a065368a01625f70f6b2380425c1908 Mon Sep 17 00:00:00 2001 From: John Baldwin 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(+) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 6a20e1038f8c..e39ee45e3e7e 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.3