FreeBSD/sys/kern/subr_kdb.c
/*
 * Initialize the kernel debugger interface.
 */
Initialize the kernel debugger interface.
Initialize the kernel debugger interface .
void
kdb_init(void)
{
	struct kdb_dbbe *be, **iter;
	int cur_pri, pri;
	kdb_active = 0;
	kdb_dbbe = NULL;
	cur_pri = -1;
	SET_FOREACH(iter, kdb_dbbe_set) {
		be = *iter;
		pri = (be->dbbe_init != NULL) ? be->dbbe_init() : -1;
		be->dbbe_active = (pri >= 0) ? 0 : -1;
		if (pri > cur_pri) {
			cur_pri = pri;
			kdb_dbbe = be;
		}
	}
	if (kdb_dbbe != NULL) {
		printf("KDB: debugger backends:");
		SET_FOREACH(iter, kdb_dbbe_set) {
			be = *iter;
			if (be->dbbe_active == 0)
				printf(" %s", be->dbbe_name);
		}
		printf("\n");
		printf("KDB: current backend: %s\n",
		    kdb_dbbe->dbbe_name);
	}
}
void kdb_init ( void ) { struct kdb_dbbe * be , * * iter ; int cur_pri , pri ; kdb_active = 0 ; kdb_dbbe = NULL ; cur_pri = -1 ; SET_FOREACH ( iter , kdb_dbbe_set ) { be = * iter ; pri = ( be -> dbbe_init != NULL ) ? be -> dbbe_init ( ) : -1 ; be -> dbbe_active = ( pri >= 0 ) ? 0 : -1 ; if ( pri > cur_pri ) { cur_pri = pri ; kdb_dbbe = be ; } } if ( kdb_dbbe != NULL ) { printf ( " " ) ; SET_FOREACH ( iter , kdb_dbbe_set ) { be = * iter ; if ( be -> dbbe_active == 0 ) printf ( " " , be -> dbbe_name ) ; } printf ( " \n " ) ; printf ( " \n " , kdb_dbbe -> dbbe_name ) ; } }
Initialize the kernel debugger interface.
Initialize the kernel debugger interface .