From 3875c9304a0d5fa03f4561ba0e1d8a859616e528 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 10 Jul 2004 22:47:06 +0000 Subject: [PATCH] Update for the KDB framework: o Make debugging code conditional upon KDB instead of DDB. o Declare ksym_start and ksym_end as extern and initialize them. This was previously and bogusly handled by DDB itself. o Call kdb_enter() instead of Debugger(). o Remove implementation of Debugger(). --- sys/i386/i386/machdep.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index b1b388c4ae7..a783e013f48 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -159,6 +160,10 @@ static void fill_fpregs_xmm(struct savexmm *, struct save87 *); #endif /* CPU_ENABLE_SSE */ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) +#ifdef DDB +extern vm_offset_t ksym_start, ksym_end; +#endif + int _udatasel, _ucodesel; u_int basemem; @@ -2080,9 +2085,15 @@ init386(first) #endif #ifdef DDB + ksym_start = bootinfo.bi_symtab; + ksym_end = bootinfo.bi_esymtab; +#endif + kdb_init(); + +#ifdef KDB if (boothowto & RB_KDB) - Debugger("Boot flags requested debugger"); + kdb_enter("Boot flags requested debugger"); #endif finishidentcpu(); /* Final stage of CPU initialization */ @@ -2744,14 +2755,6 @@ user_dbreg_trap(void) return 0; } -#ifndef DDB -void -Debugger(const char *msg) -{ - printf("Debugger(\"%s\") called.\n", msg); -} -#endif /* no DDB */ - #ifndef DEV_APIC #include @@ -2853,12 +2856,12 @@ lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger) } #endif -#ifdef DDB +#ifdef KDB /* * Provide inb() and outb() as functions. They are normally only * available as macros calling inlined functions, thus cannot be - * called inside DDB. + * called from the debugger. * * The actual code is stolen from , and de-inlined. */ @@ -2897,4 +2900,4 @@ outb(u_int port, u_char data) __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); } -#endif /* DDB */ +#endif /* KDB */