Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_kdb.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#include <machine/kdb.h> | #include <machine/kdb.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#ifdef SMP | #ifdef SMP | ||||
#include <machine/smp.h> | #include <machine/smp.h> | ||||
#endif | #endif | ||||
#include <security/mac/mac_framework.h> | |||||
u_char __read_frequently kdb_active = 0; | u_char __read_frequently kdb_active = 0; | ||||
static void *kdb_jmpbufp = NULL; | static void *kdb_jmpbufp = NULL; | ||||
struct kdb_dbbe *kdb_dbbe = NULL; | struct kdb_dbbe *kdb_dbbe = NULL; | ||||
static struct pcb kdb_pcb; | static struct pcb kdb_pcb; | ||||
struct pcb *kdb_thrctx = NULL; | struct pcb *kdb_thrctx = NULL; | ||||
struct thread *kdb_thread = NULL; | struct thread *kdb_thread = NULL; | ||||
struct trapframe *kdb_frame = NULL; | struct trapframe *kdb_frame = NULL; | ||||
▲ Show 20 Lines • Show All 662 Lines • ▼ Show 20 Lines | #endif | ||||
kdb_cpu_trap(type, code); | kdb_cpu_trap(type, code); | ||||
makectx(tf, &kdb_pcb); | makectx(tf, &kdb_pcb); | ||||
kdb_thr_select(curthread); | kdb_thr_select(curthread); | ||||
cngrab(); | cngrab(); | ||||
for (;;) { | for (;;) { | ||||
#ifdef MAC | |||||
if (mac_kdb_check_backend(be) != 0) { | |||||
printf("MAC prevented execution of KDB backend: %s\n", | |||||
be->dbbe_name); | |||||
/* Unhandled breakpoint traps are fatal. */ | |||||
handled = 1; | |||||
break; | |||||
} | |||||
#endif | |||||
handled = be->dbbe_trap(type, code); | handled = be->dbbe_trap(type, code); | ||||
if (be == kdb_dbbe) | if (be == kdb_dbbe) | ||||
break; | break; | ||||
be = kdb_dbbe; | be = kdb_dbbe; | ||||
if (be == NULL || be->dbbe_trap == NULL) | if (be == NULL || be->dbbe_trap == NULL) | ||||
break; | break; | ||||
printf("Switching to %s back-end\n", be->dbbe_name); | printf("Switching to %s back-end\n", be->dbbe_name); | ||||
} | } | ||||
Show All 17 Lines |