Compaq AA-RH99A-TE Remote Starter User Manual


 
1.2 Debugging Kernel Programs
Kernel programs can be difficult to debug because you normally cannot
control kernel execution. To make debugging kernel programs more
convenient, the system provides the
kdebug debugger. The kdebug
debugger is code that resides inside the kernel and allows you to use the dbx
debugger to control execution of a running kernel in the same manner as
you control execution of a user space program. To debug a kernel program
in this manner, follow these steps:
1. Build your kernel program into the kernel on a test system.
2. Set up the kdebug debugger, as described in Section 2.3.
3. Issue the dbx -remote command on a remote build system, supplying
the pathname of the kernel running on the test system.
4. Set breakpoints and enter dbx commands as you normally would.
Section 2.1 describes some of the commands that are useful during
kernel debugging. For general information about using dbx, see the
Programmer’s Guide.
The system also provides the kdbx debugger, which is designed especially
for debugging kernel code. This debugger contains a number of special
commands, called extensions, that allow you to display kernel data
structures in a readable format. Section 2.2 describes using kdbx and its
extensions. (You cannot use the kdbx debugger with the kdebug debugger.)
Another feature of kdbx is that you can customize it by writing your own
extensions. The system contains a set of kdbx library routines that you can
use to create extensions that display kernel data structures in ways that are
meaningful to you. Chapter 3 describes writing kdbx extensions.
1.3 Debugging the Running Kernel
When you have problems with a process or set of processes, you can attempt
to identify the problem by debugging the running kernel. You might also
invoke the debugger on the running kernel to examine the values assigned
to system parameters. (You can modify the value of the parameters using
the debugger, but this practice can cause problems with the kernel and
should be avoided.)
You use the dbx or kdbx debugger to examine the state of processes running
on your system and to examine the value of system parameters. The kdbx
debugger provides special commands, called extensions, that you can use to
display kernel data structures. (Section 2.2.3 describes the extensions.)
To examine the state of processes, you invoke the debugger (as described in
Section 2.1 or Section 2.2) using the following command:
Introduction to Kernel Debugging 1–3