beautypg.com

Compaq COBOL AAQ2G1FTK User Manual

Page 576

background image

Programming Productivity Tools
C.4 OpenVMS Debugger (OpenVMS)

21.

You can examine any character of a subscripted data item by specifying the
character position. The following EXAMINE command accesses the second
character on TEMP-CHAR.

DBG> EXAMINE TEMP-CHAR(2)
TEMP-CHAR of TESTA\TESTB\TEMP-WORD(2):

"b"

22.

You can use the DEPOSIT command to put a value into any element of a
table and examine its contents. In this example,

"

x

"

is deposited into the

second character position of TEMP-CHAR.

DBG> DEPOSIT TEMP-CHAR(2)="x"
DBG> EXAMINE TEMP-CHAR(2)
TEMP-CHAR of TESTA\TESTB\TEMP-WORD(2):

"x"

23.

You can qualify data names in debug commands as you can in COBOL. For
example, if you examine IN-WORD while you debug your program, you can
use the following DEBUG command:

DBG> EXAMINE IN-WORD of TESTA-DATA
IN-WORD OF TESTA\TESTA-DATA:

"axc"

24.

Deposit a value into CHARCT.

DBG> DEPOSIT CHARCT=8.00

25.

Resume execution with the GO 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.

DBG> GO
cba
trace at TESTA\%LINE 15

15:

PERFORM SHOW-IT.

watch of DISP-COUNT of TESTA\TESTA-DATA at TESTA\%LINE 19+52

19:

MOVE LET-CNT TO DISP-COUNT.

old value =

0

new value =

3

break at TEST-A\%LINE 20

20:

DISPLAY DISP-COUNT " CHARACTERS".

26.

To see the image’s current location, use the SHOW CALLS command.

DBG> SHOW CALLS
module name

routine name

line

rel PC

abs PC

*TESTA

TESTA

22

00000120

00030120

00000080

000306C0

LIB$INITIALIZE

85739D00

8576A530

00000080

7FE61F30

27.

Resume execution with the GO command. TESTA executes its final display.
The debugger regains control when STOP RUN executes.

DBG> GO
03 CHARACTERS
%DEBUG-I-EXITSTATUS, is ’%SYSTEM-S-NORMAL, normal successful completion’

28.

At this point, you can either examine the contents of data items or end the
session with the EXIT command.

DBG> EXIT
$

C–12 Programming Productivity Tools