Compaq AAQ2G1FTK Marine Radio User Manual


 
Programming Productivity Tools
C.3 Ladebug Debugger (Tru64 UNIX)
16. Deposit a new value into CHARCT.
(ladebug) assign charct=15.95
17. CHARCT now contains the new value.
(ladebug) print charct
15.95
18. You can examine any character of a subscripted data item by specifying the
character position. The following EXAMINE command accesses the second
character in TEMP-CHAR.
(ladebug) print temp-char of temp-word(2)
"b"
19. You can qualify data names in debug commands as you can in Compaq
COBOL. For example, if you examine IN-WORD while you debug your
program, you can use the following Ladebug Debugger command:
(ladebug) print in-word of testa-data
"abc "
20. Restore CHARCT to its original value.
(ladebug) assign charct=3.00
21. Resume execution with the
cont
command. The program TESTA displays
the reversed word. When the image reaches line 19 in TESTA, the debugger
detects that an instruction changed the contents of DISP-COUNT. Because
you set a watchpoint on DISP-COUNT, the debugger displays the old and new
values, then returns control to you.
(ladebug) cont
[3] [calling testa from main cob_main.c:253 0x3ff8181f054]
cba
[4] The value of DISP-COUNT of TESTA-DATA was changed in testa,
before entering cob_acc_display
Old value = 0
New value = 3
[4] stopped at [cob_acc_display:349 0x3ff81808744]
(Cannot find source file cob_accdis.c)
Note that the Ladebug Debugger ‘‘watch’’ command shown here (
stop disp-
count of testa-data
) does not stop immediately at the point when the value
of the watched variable changes. In this example, the debugger takes control
at the first procedure call or return after the value of the watched variable
changes. For more information on the behavior of Ladebug Debugger
watch
,
see the Ladebug Debugger Manual.
22. To see the executable’s current location, use the
where
command. Then, set
the debugger file scope back to the main COBOL program, and stop at a
specified line number in that file.
(ladebug) where
>0 0x3ff81808744 in cob_acc_display() cob_accdis.c:349
#1 0x120001fbc in testa() testa.cob:20
#2 0x3ff8181f054 in main() cob_main.c:253
(ladebug) file testa.cob
(ladebug) stop at 20
[#6: stop at "testa.cob":20 ]
Programming Productivity Tools C7