STREAMS/UX for the HP 9000 Reference Manual
181
Debugging STREAMS/UX Modules and Drivers
Using adb
[2] Print out the new value of sp. This information should be saved in case you
need to find out the contents of registers which have been pushed onto the stack
frame. See adb documentation for more information about the concept of “.”,
the current location in the core file.
[3] adb output in response to the previous command, .=X
3 Find the current return pointer.
Your current procedure is doadump, and you have just set sp so that it is the
same value it was when doadump was first entered, before the ldo instruction
was executed. Recall that doadump's first instruction is:
stw rp,-14(sp)
Because you have just set sp to the same value it had when doadump's first
instruction was executed, you can find the rp by looking at what is in sp-0x14:
<sp-0x14/X [1]
crash_monarch_stack+1EC: 0xDBF48 [2]
[1] Print out the value of the location sp-0x14 in hexadecimal.
[2] adb's response. crash_monarch_stack+1EC can safely be ignored.
0xDBF48 is the instruction address which was in rp.
4 Find out which procedure the return pointer points to.
The adb i command will tell you this:
0xDBF48/i [1]
panic_boot+354: comibt,=,n 0,ret0,panic_boot+368 [2]
[1] use of the i command
[2] adb's response
Notice that the $r command has already indicated that rp corresponds to
panic_boot+354.
To continue back-tracing the stack, iterate the four steps shown above. Here
is the adb sequence of commands and responses to trace the next two levels
back in this stack. Text preceded by “#” are comments.
panic_boot/3i # look at beginning of
panic_boot: # panic_boot for stack frame
panic_boot: stw rp,-14(sp) # size
stwm r3,80(sp) # stack frame size is 0x80
stw r4,-7C(sp)
<sp-0x80>sp # calculate new sp
.=X # print out new sp
20F2D0
<sp-0x14/X # find rp in caller's