Entering a kernel debugger from a driver
If you are debugging a device driver or another part
of the kernel,
it is useful to force the debugger to be called
at certain times.
The following methods are available:
-
DDI version 8 and later version drivers can use the
call_demon(D3)
function, which stops the kernel
and calls the currently configured kernel debugger
when the driver is compiled with the -DDEBUG flag.
When the kernel debugger is exited,
control returns to the caller.
-
SCO OpenServer 5 drivers (ODDI version 3 and later)
can use the
calldebug(D3oddi)
function, which stops the kernel
and calls scodb
when the driver is compiled under -DDEBUG mode.
When the kernel debugger is exited,
control returns to the caller.
-
All DDI and ODDI drivers
can also use the
ASSERT(D3)
function with CE_PANIC mode
within -DDEBUG sections of code
to check for certain conditions and,
if appropriate, panic the system,
which calls the currently-configured kernel debugger.
Use the
ASSERT(D3)
function to check that the value
of variables and structure members is correct
at various stages of execution.
ASSERT( )
evaluates a simple expression and,
if it is not true,
panics the system at that point
so you can use a kernel debugger
or the
crash
or
crash(ADM)
command
to analyze the kernel.
ASSERT( )
is ignored except when the driver
is compiled with the -DDEBUG flag.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005