STREAMS/UX for the HP 9000 Reference Manual
198
Debugging STREAMS/UX Modules and Drivers
Debugging Examples
this, and want to look at the rest of *lp. To do so, we need to find the value
of r3 at the time of the panic. We may be able to extract this information
from the stack if we know the value of sp at the time of the panic. To get this
information, we do a manual stack back-trace. See “Manual Stack
Back-Tracing” for details on how this is done. The resulting table is shown
below:
Now that we have the values of sp, we want to look into the stack of the
procedure above sp_timeout() in the stack trace to find what value that
procedure saved in its stack for r3. In this case, the procedure above
sp_timeout() is $ihndlr_rtn. $ihndlr_rtn is one of the low-level kernel utility
procedures which is hand-coded in assembly and does not create a normal
stack frame. Instead it creates a “save state” area, which contains the values
of all the registers at the time the trap or interrupt took place. The structure
save_state is defined in /usr/include/machine/save_state.h. The general
registers are stored first, and are located at “top of save state area” +
“register number” * 4. For example, r3 will be 3*4 = 12 off of the beginning
of the save state area. To find the top of the save state area, subtract the size
of the save_state structure from the value of sp for $ihndlr_rtn:
0x16560-0x230>sp # set sp to top of trap save state
<sp/X
16330: 0xF000009 # first word of save state area
<sp+0xC/X # find contents of r3 (lp) at sp + 3*4
icsBase+33C: 24C258
24C258+0x8/X # find 8 off of r3 (lp->mp)
sp_sp+18: 0 # lp->mp is NULL
0x24c258/4X # look at all of lp:
# state *sp_rdq *mp *last_mp
sp_sp+10: 1 1040C00 0 10F7C00
We can also use strdb to look at lp. (See the strdb section of this chapter for
details.) There may be several instances of the sp driver, each with a
different minor number, so we must look at each one until we find the
sp pcoqh Procedure Address Frame Size
0x1fdb80
0x1fdb50
0x1fdad0
0x16860
0x167e0
0x16560
0x16330
0x162f0
0x24b34
0xc8f48
0xc8938
0x13e8cc
0xcddb8
0xbc93c
0x3b2cc
0x12e2bc
doadump+0xec
panic_boot+0x354
boot+0x24
panic+0xf0
interrupt+0x7e8
$ihndlr_rtn
sp_timeout+0x2c
softclock+0x94
0x30
0x80
0x100
0x80
0x280
0x230
0x40
0x80