In the case of reentering the debugger due to an attempt to perform a

context switch while in the debugger, reenter the debugger sooner before
performing any statistics updates.
This commit is contained in:
jhb 2006-06-03 20:49:44 +00:00
parent 9c15984c1b
commit dc064c4d48

View File

@ -357,6 +357,16 @@ mi_switch(int flags, struct thread *newtd)
("mi_switch: switch must be voluntary or involuntary"));
KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself"));
/*
* Don't perform context switches from the debugger.
*/
if (kdb_active) {
mtx_unlock_spin(&sched_lock);
kdb_backtrace();
kdb_reenter();
panic("%s: did not reenter debugger", __func__);
}
if (flags & SW_VOL)
p->p_stats->p_ru.ru_nvcsw++;
else
@ -377,16 +387,6 @@ mi_switch(int flags, struct thread *newtd)
td->td_generation++; /* bump preempt-detect counter */
/*
* Don't perform context switches from the debugger.
*/
if (kdb_active) {
mtx_unlock_spin(&sched_lock);
kdb_backtrace();
kdb_reenter();
panic("%s: did not reenter debugger", __func__);
}
/*
* Check if the process exceeds its cpu resource allocation. If
* it reaches the max, arrange to kill the process in ast().