From 7b9d0458105831a79d211f1ca98a184adedf82f5 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 21 Dec 2009 23:00:13 +0100 Subject: Add a SoftDebugger function * kern/debug.h (SoftDebugger): Add prototype. * kern/debug.c (Debugger): Move code invoking debugging trap to... (SoftDebugger): ... new function. Print the passed message. * kern/lock_mon.c (decl_simple_lock_data, retry_bit_lock): Call SoftDebugger instead of Debugger. * device/ds_routines.c (ds_device_open, device_read, device_read_inband): Call SoftDebugger instead of Debugger. * i386/i386at/model_dep.c (c_boot_entry): Call SoftDebugger instead of Debugger. * kern/syscall_sw.c (null_port, kern_invalid): Call SoftDebugger instead of Debugger. * vm/vm_object.c (vm_object_collapse): Call SoftDebugger instead of Debugger. --- kern/debug.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'kern/debug.c') diff --git a/kern/debug.c b/kern/debug.c index 57a8126..26445f8 100644 --- a/kern/debug.c +++ b/kern/debug.c @@ -73,17 +73,16 @@ Assert(char *exp, char *file, int line) Debugger("assertion failure"); } -void Debugger(message) +void SoftDebugger(message) char * message; { + printf("Debugger invoked: %s\n", message); + #if !MACH_KDB - panic("Debugger invoked, but there isn't one!"); + printf("But no debugger, continuing.\n"); + return; #endif -#ifdef lint - message++; -#endif /* lint */ - #if defined(vax) || defined(PC532) asm("bpt"); #endif /* vax */ @@ -104,6 +103,16 @@ void Debugger(message) #ifdef i386 asm("int3"); #endif +} + +void Debugger(message) + char * message; +{ +#if !MACH_KDB + panic("Debugger invoked, but there isn't one!"); +#endif + + SoftDebugger(message); panic("Debugger returned!"); } -- cgit v1.2.3