STREAMS/UX for the HP 9000 Reference Manual
187
Debugging STREAMS/UX Modules and Drivers
Using adb
realloccg: stw rp,-14(sp)
realloccg+4: stwm r3,80(sp)
realloccg+8: stw r4,-7C(sp)
realloccg+0xC: stw r5,-78(sp)
realloccg+10: stw r6,-74(sp)
realloccg+14: stw r7,-70(sp)
realloccg+18: stw r8,-6C(sp)
realloccg+1C: stw r9,-68(sp)
realloccg+20: stw r10,-64(sp)
realloccg+24: or arg0,r0,r3
realloccg+28: or arg1,r0,r6
realloccg+2C: or arg2,r0,r7
realloccg+30: or arg3,r0,r4
Here is rmvq() storing its arguments away in its stack frame:
rmvq: stw rp,-14(sp)
rmvq+4: ldo 80(sp),sp
rmvq+8: stw arg0,-0xA4(sp)
rmvq+0xC: stw arg1,-0xA8(sp)
If the arguments were put into callee save registers, the next procedure up in
the stack trace will save these registers in its stack frame. You can retrieve
these values from the stack. If the arguments are stored on the stack frame,
you can also retrieve them from the stack. But first you must make sure that
the contents of the callee save registers or the stack frame locations you are
interested in were not modified between the time the arguments were loaded
at the beginning of the procedure and the time the next procedure call on the
stack trace took place. The easiest way to determine this is to have adb print
out the assembly code for the procedure into a file and use an editor such as
vi to find all references to the register between the beginning of the
procedure and the branch to the next procedure in the stack trace. If none of
these references modify the register, the value which the next procedure has
saved in its stack frame is valid.
To print the assembly of a procedure to a file using adb:
$>filename [1]
procedure,100/ia [2]
$> [3]
[1] Tell adb to direct stdout to the file filename. There should be no space
between $> and the filename.
[2] Print the first 0x400 instructions of procedure.
[3] Set stdout back to the terminal.