How to call the kernel debugger from a driver (ISC 2.0.2)

Steve Alexander stevea at i88.isc.com
Thu Aug 23 10:16:46 AEST 1990


In article <433 at echbull.bull.fr> armand at sm14.ec.bull.fr (Armand HORNIK) writes:
>call the kernel debugger (for debugging usage) from my driver.

I think you can issue the call debugger(0, (long *)0) from within your code.
I've done a similar thing under AT&T 3.2* on occasion, and it can be very 
helpful.

The first argument is a trap code, and shouldn't be non-zero, since
that would cause some things to happen that might assume that your
second argument is valid.  The second argument is the value of the 
saved frame pointer, which you probably don't have since you're not the
trap processing code.  Among other things, a non-zero first argument
causes the debugger to disassemble and display the instruction at the saved IP
location when you enter the debugger via a panic.

Debugger(0, (long *)0) is basically how the kd driver gets into the
debugger when you issue a CTRL-ALT-D (K_DBG) request.

Hope this helps.  Good luck.

[*] Under AT&T 3.2 and 4.0, the debugger entry point is called _debugger,
and it only takes the first argument.  It obtains the saved frame pointer
via other means.  Systems using the GDEBUGGER have a different entry
point, which I have never used.
--
Steve Alexander, Software Technologies Group    | stevea at i88.isc.com
INTERACTIVE Systems Corporation, Naperville, IL | ...!{sun,ico}!laidbak!stevea



More information about the Comp.unix.i386 mailing list