Programming Productivity Tools
C.3 Ladebug Debugger (Tru64 UNIX)
8. Use the
list
command to display the source lines where you set breakpoints.
(ladebug) list 43,50
43 PERFORM LOOK-BACK VARYING SUB-1 FROM 20 BY -1
44 UNTIL TEMP-CHAR (SUB-1) NOT = SPACE.
45 MOVE SUB-1 TO CHARCT.
46 PERFORM MOVE-IT VARYING SUB-2 FROM 1 BY 1 UNTIL SUB-1 = 0.
47 MOVE HOLD-WORD TO TEMP-WORD.
48 MOVE-IT.
49 MOVE TEMP-CHAR (SUB-1) TO HOLD-CHAR (SUB-2).
50 SUBTRACT 1 FROM SUB-1.
9. Set a tracepoint at line 15 of TESTA.
(ladebug) trace at 15
[#3: trace at "testa.cob":15 ]
10. Set a watchpoint on the data item DISP-COUNT.When an instruction tries
to change the contents of DISP-COUNT,the debugger returns control to you.
(ladebug) stop disp-count of testa-data
[#4: stop if DISP-COUNT of TESTA-DATA changes ]
11. Execution resumes with the
cont
command. Each time line 50 in TESTB
executes, the debugger executes the command list associated with this line; it
displays the contents of HOLD-CHARS and SUB-1, then resumes execution.
Finally,the debugger returns control to the user when the breakpoint at line
47 is reached.
(ladebug) cont
[3] when [TESTB:50 0x120001c1c]
"c "
3
[3] when [TESTB:50 0x120001c1c]
"cb "
2
[3] when [TESTB:50 0x120001c1c]
"cba "
1
[2] stopped at [TESTB:47 0x120001ba4]
47 MOVE HOLD-WORD TO TEMP-WORD.
12. Examine the contents of SUB-1.
(ladebug) whatis sub-1
unsigned short SUB-1
(ladebug) print sub-1
0
13. Deposit the value –42 into data item SUB-2.
(ladebug) whatis sub-2
pic s99 usage comp-3 SUB-2
(ladebug) assign sub-2=-42
14. Examine the contents of SUB-2.
(ladebug) print sub-2
-42
15. Examine the contents of CHARCT,whose picture is 99V99.
(ladebug) whatis charct
pic 99v99 usage display charct
(ladebug) print charct
3.00
C6Programming Productivity Tools