adb Core Analysis
adb can be used to analyze a core file to determine the
cause of a panic. Note that Solaris versions to 7 require that adb
be run on a system with the same system type and OS as the machine
that produced the core dump. Solaris 8+ allows adb to run on a
different system type.
The following procedure is useful for diagnosing system crashes due to
traps:
To invoke adb on a core file, type: adb -k unix.n vmcore.n.
$< msgbuf prints out the message buffer. Of particular interest
are the error messages, g7 (the current thread address),
rp (the register pointer), pc (the program counter address),
and sp (the stack pointer).
(Note: We can also find this information by using
strings vmcore.n | more.)
Alternatively we can find rp by using $c to
display the stack and picking up the second argument to trap
or die. We can then find pc by
executing rp_address$< regs.
The instructions in the program counter can be displayed with
pc_address/40ai. (A truncated version can be displayed
with pc_address/ai.)
g7 can also be obtained by looking at the panic_thread
variable with panic_thread/X for 32-bit or
panic_thread/K for 64-bit systems.
In order to look at the command that caused the panic, we need to
find procp by running g7_address$< thread.
The command will be located in the psargs field of the
output from procp_address$< proc2u. The remainder
of the output from this command represents the user structure of the
process.