
Driver Testing and Debugging
15-1
The system automatically saves the dump image when it detects an improper shutdown.
By default, when entering multi-user mode, the memory image and the kernel image are
saved to /var/crashfiles.
NOTE
To reduce the amount of memory to be copied to disk at a system
crash, you can reduce the amount of RAM used by the system by
using the MAXPMEM tunable parameter. This parameter is set in
the /etc/conf/mtune.d/kernel file.
Initializing crash on the Memory Dump 15
To run crash on the core image of memory at the time the system panicked, you must
have saved the core image before rebooting and the file containing the kernel bootable
image (/stand/unix file by default) that was running at the time of the crash.
If the bootable kernel image is named something other than /stand/unix (either
because it was named something else at the time of the panic or because you copied it to
another name after the panic), use the -n option or the second positional parameter to
specify that file name. If you want the output of crash to be written to a file rather than
your terminal (standard output), use the -w option with the name of the file. Note that the
output of a specific crash command can be redirected to a file even if you do not use the
-w in the crash command line.
Using crash Functions 15
The crash session begins by reporting the dumpfile, namelist, and outfile being used, fol-
lowed by the crash prompt (>). Requests in the crash session have the following stan-
dard format
command [argument...]
where command is one of the supported commands of crash and argument includes any
qualifying data relevant to the requested command. Use the q command to end the crash
session.
See the crash(1M) manual page for a list of supported commands. Note that, while
most crash commands are common to all computers, each system also has unique
commands that relate to specific devices supported on that machine.
Following is a list of crash commands often useful when debugging a driver.
dis Disassemble from a starting address. Use this information to trace
code flow. However, you have to mentally convert the resulting
assembler code to C programming language statements.
od List memory. Use this command when you suspect that the stack
is corrupted, or to list the contents of memory at a certain address.
If you are listing the contents of the stack, you have to manually
find the boundaries of each stack entry, called stack frames. To get
Comments to this Manuals