HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
The Ladebug Debugger is used to debug HP COBOL programs on the Tru64 UNIX operating system.
This section provides a representative debugging session that is designed to demonstrate the use of debugger features. For complete reference information on the Ladebug Debugger, you should refer to the Ladebug Debugger Manual in the Tru64 UNIX operating system documentation set. Online help is immediately available to you during a debugging session when you type help command at the debugger prompt (ladebug) . Additional information about the flags shown in this section is available in the man page. For example, you can type man cobol , and page to the appropriate topic to read information about the flags ( -g , -o ) used at the beginning of the example in this section.
% cobol -g -o testa testa.cob cobol: Warning: file not optimized; use -g3 for debug with optimize % |
% ladebug testa Welcome to the Ladebug Debugger Version 2.0.8 eft ------------------ object file name: testa Reading symbolic information ...done (ladebug) |
(ladebug) stop at 43 [#2: stop at "testa.cob":43 ] |
(ladebug) run ENTER WORD |
abc [2] stopped at [TESTB:43 0x120001aa4] 43 PERFORM LOOK-BACK VARYING SUB-1 FROM 20 BY -1 |
(ladebug) stop at 47 [#2: stop at "testa.cob":47 ] (ladebug) when at 50 { print chars of hold-chars; print SUB-1; cont; } [#3: when at "testa.cob":50 { print CHARS of HOLD-CHARS; print SUB-1; ; cont ; } ] |
(ladebug) status #1 PC==0x120001e14 in testa "testa.cob":2 { break } #2 PC==0x120001ba4 in TESTB "testa.cob":47 { break } #3 PC==0x120001c1c in TESTB "testa.cob":50 { ; print CHARS of HOLD-CHARS; print SUB-1; ; cont ; ; } |
(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. |
(ladebug) trace at 15 [#3: trace at "testa.cob":15 ] |
(ladebug) stop disp-count of testa-data [#4: stop if DISP-COUNT of TESTA-DATA changes ] |
(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. |
(ladebug) whatis sub-1 unsigned short SUB-1 (ladebug) print sub-1 0 |
(ladebug) whatis sub-2 pic s99 usage comp-3 SUB-2 (ladebug) assign sub-2=-42 |
(ladebug) print sub-2 -42 |
(ladebug) whatis charct pic 99v99 usage display charct (ladebug) print charct 3.00 |
(ladebug) assign charct=15.95 |
(ladebug) print charct 15.95 |
(ladebug) print temp-char of temp-word(2) "b" |
(ladebug) print in-word of testa-data "abc " |
(ladebug) assign charct=3.00 |
(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) |
(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 ] |
(ladebug) cont 03 CHARACTERS Thread has finished executing |
(ladebug) q <> |
Previous | Next | Contents | Index |