![]() |
HP OpenVMS systems documentation |
| Previous | Contents | Index |
I64 example:
X0+00000380! mov r7 = r23S (1) X0+00000381! nop.f 000000S X0+00000382! br.call.sptk.many b0 = 0000E30 O (2) X0+00000390! mov r29 = r41S (3) X0+00000391! mov r1 = r40S |
Executes one instruction and displays the next. If the executed instruction is a call to a subroutine, it steps into the subroutine and displays the next instruction to be executed in the subroutine.
S
The Step Instruction command executes one instruction and displays the next instruction (in instruction mode) and its address. Use this command to single-step instructions, including single-stepping all instructions in subroutines. If you want to exclude single-stepping instructions in subroutines, use the O command.The instruction displayed has not yet been executed. This command sets a flag to change the display mode to instruction mode. Any subsequent Close Current Location, Open Next (LINEFEED) commands and Open and Display Indirect Location (TAB) commands will display locations as machine instructions. The Open Location and Display Contents (/) command clears the flag, causing the display mode to revert to longword, hexadecimal mode.
On VAX, if the instruction being executed is a BSBB, BSBW, JSB, CALLG, or CALLS instruction, Step moves to the subroutine called by these instructions and displays the first instruction within the subroutine.
On Alpha, if the instruction being executed is a JSR or BSR instruction, Step moves to the subroutine called by these instructions and displays the first instruction within the subroutine.
Note
If DELTA/XDELTA does not have write access to the target of a JSR instruction, you cannot use the S or ;P command at the JSR instruction. First, you must use the O command; then you can use the S or ;P command.On I64, if the instruction is a br.call instruction, Step moves to the subroutine called by these instructions and displays the first instruction within the subroutine.
On Alpha and VAX, in general, you move to the instruction where you want to start single-step execution by placing a breakpoint at that instruction and typing ;P. Then press S to execute the first instruction and display the next one.
OpenVMS VAX example:
00000690/CMPL R0,#000009A8 S (1) 00000697/BEQL 0000069D S (2) 00000699/BSBB 000006A2 S (3) 000006A2/PUSHL R2 (4)
- Step program execution is started at address 690. The instruction at 690 is executed and the next instruction is displayed. Step execution is continued using S.
- At address 697, there is a branch instruction to the instruction at address 69D. However, because the condition (BEQL) is not met, program execution continues at the next instruction. The next S command is executed.
- At address 699, there is a branch instruction to the instruction at address 6A2, a subroutine. The next S command is executed.
- Program execution moves to the subroutine.
Alpha example:
0003003C! BLBC R0,#X000006 S (1) 00030040! LDQ R16,#X0050(R2) S (2) 00030044! BIS R31,R31,R17 S (3) 00030048! LDQ R26,#X0040(R2)
- Step program execution is started at address 3003C. The instruction at 3003C is a conditional branch instruction. Step execution is continued using the S command.
- Because the condition (BLBC) was not met, program execution continued at the next instruction at address 30040. Had the branch been taken, execution would have continued at address 30058. The second S command causes the LDQ instruction to be executed.
- The instruction at address 30044 is displayed. The S command is executed.
I64 example:
X0+00000061! mov r52 = b0 S (1) X0+00000062! mov r40 = r1 S (2) X0+00000070! st8 [r12] = r0 ;; (3)
- Program execution has been stopped at base register X0 plus offset 0000061. The instruction at this address is a Move Branch Register. Step execution is continued using the S command.
- Program execution is now stopped at base register X0 plus offset 0000062. The instruction at this address is a Move Application Register. Step execution is then continued using the S command.
- The instruction at offset 0000070 is displayed.
Deposits the ASCII string at the current address.
'string'
string
The string of characters to be deposited.
The Deposit ASCII String command deposits string at the current location (.) in ASCII format. The second apostrophe is required to terminate the string. All characters typed between the first and second apostrophes are entered as ASCII character text. Avoid embedding an apostrophe (') within the string you want to deposit.When you want to use key commands (LINEFEED, RETURN, ESC, or TAB), press the key. These commands are entered as text.
This command stores the characters in 8-bit bytes and increments the current address (.) by one for each character stored.
This command does not change the prevailing display mode.
7FFE1600/'R0/[Linefeed][Linefeed]'The ASCII string "R0/[Linefeed] [Linefeed]" is stored at address 7FFE1600. This string, if subsequently executed with the ;E command, examines the contents of general register 0 (the command R0/), then examines two subsequent registers (using two LINEFEED commands).
Evaluates an expression and displays its value.
expression =
expression
The expression to be evaluated.
The Display Value of Expression command evaluates an expression and displays its value in hexadecimal. The expression can be any valid DELTA/XDELTA expression. See Section 2.1 for a description of DELTA/XDELTA expressions.All calculations and displays are in hexadecimal in the prevailing length mode.
Note
Because DELTA and XDELTA treat the space as an addition operator, do not enter an unnecessary space.
FF+1=00000100 (1) A-1=00000009 (2)
Displays the ASCII text string enclosed in backslashes.
\string\
This mode is useful when creating your own predefined command strings. Use the backslash to begin and end an ASCII text string. Follow the ending backslash with a terminator. When DELTA or XDELTA encounters the ending backslash and terminator, it prints the ASCII text string.
This appendix gives an example of using DELTA to debug a program on OpenVMS VAX. The program, LOGINTIM, uses the system service SYS$GETJPI to obtain the login times of each process. Although this is an example of using DELTA, most of the commands in the example could be used in an XDELTA debugging session.
To run this program without error, you need WORLD privilege.
The .LIS file is listed in Example A-1. Only the offsets and source code are shown.
| Example A-1 Program for Getting LOGINTIMs |
|---|
0000 1 ;++ 0000 2 ; This sample program uses the wildcard feature of GETJPI to get the 0000 3 ; LOGINTIM for each active process. It outputs the PID and LOGINTIM 0000 4 ; for each and exits when there are NOMOREPROCs. 0000 5 ;-- 0000 6 0000 7 ; 0000 8 ; Data areas. 0000 9 ; 0000 10 DEVNAM: .ASCID /SYS$OUTPUT/ ;Output device specifier 000E 0012 11 0012 12 CHAN: .LONG 0 ;Assigned output channel 0016 13 0016 14 ITMLST: ;Item list for GETJPI call 0016 15 .WORD 8 ; Byte length of output buffer 0018 16 .WORD JPI$_LOGINTIM ; Specify LOGINTIM item code 001A 17 .ADDRESS TIME ; Address of output buffer 001E 18 .LONG 0 ; Not interested in return length 0022 19 .LONG 0 ;Item list terminator 0026 20 0026 21 TIME: .QUAD 0 ;Buffer to hold LOGINTIM 002E 22 002E 23 OUTLEN: .LONG 0 ;FAO buffer length 0032 24 OUTBUF: .LONG 1024 ;FAO buffer descriptor 0036 25 .ADDRESS BUF 003A 26 BUF: .BLKB 1024 ;FAO buffer 043A 27 043A 28 CTRSTR: .ASCID *!/!_PID= !XW!_LOGINTIME= !%T* ;FAO control string 0448 0454 045E 29 045E 30 PIDADR: .LONG -1 ;Wildcard PID control longword 0462 31 0462 32 ;++ 0462 33 ; Start of program. 0462 34 ;-- 0462 35 S: .WORD 0 ;Entry mask 0464 36 $ASSIGN_S DEVNAM,CHAN ;Assign output channel 0475 37 MOVAB TIME,R2 ;Load pointer to LOGINTIM 047A 38 ; output buffer 047A 39 LOOP: $GETJPI_S ITMLST=ITMLST,-;Get LOGINTIM for a process 047A 40 PIDADR=PIDADR 0490 41 CMPL R0,#SS$_NOMOREPROC ;Are we done? 0497 42 BEQL 5$ ;If EQL yes 0499 43 BSBB GOT_IT ;Process data for this process 049B 44 BRB LOOP ;Look for another process 049D 45 049D 46 5$: MOVZBL #SS$_NORMAL,R0 ;Set successful completion code 04A1 47 RET ;Return, no more processes 04A2 48 04A2 49 GOT_IT: $FAO_S CTRSTR,- ;Format the output data 04A2 50 OUTLEN,- 04A2 51 OUTBUF,- 04A2 52 PIDADR,R2 04B9 53 $QIOW_S CHAN=CHAN,- ;Output to SYS$OUTPUT 04B9 54 FUNC=#IO$_WRITEVBLK,- 04B9 55 P1=BUF,- 04B9 56 P2=OUTLEN 04DC 57 RSB ;Done with this process data 04DD 58 04DD 59 .END S |
The .MAP file is listed in Example A-2. Only the Program Section Synopsis with the PSECT, MODULE, base address, end address, and length are listed.
| Example A-2 LOGINTIM Program .Map File |
|---|
+--------------------------+
! Program Section Synopsis !
+--------------------------+
Psect Name Module Name Base End Length
---------- ----------- ---- --- ------
. BLANK . 00000200 000006E2 000004E3 ( 1251.)
.MAIN. 00000200 000006E2 000004E3 ( 1251.)
|
The DELTA debugging session is listed in Example A-3.
| Example A-3 DELTA Debugging Session Example |
|---|
$ DEFINE LIB$debugging SYS$LIBRARY:DELTA (1) $ RUN/debugging LOGINTIM (2) DELTA Version 6.0 00000664/CLRQ -(SP) 200,1;X (3) 00000200 (4) X1 490!CMPL R0,#000009A8 .;B (5) X1 499!BSBB X1+04A2 .;B (6) ;P (7) 1 BRK AT 00000690 X1+0490/CMPL R0,#000009A8 R0/00000001 ;P (8) 2 BRK AT 00000699 X1+499/BSBB X1+04A2 O (9) PID= 0000 LOGINTIME= 00:00:00.00 (10) X1+049B/BRB X1+047A ;P (11) 1 BRK AT 00000690 X1+0490/CMPL R0,#000009A8 R0/00000001 ;P (12) 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 O (13) PID= 0001 LOGINTIME= 00:00:00.00 X1+049B/BRB X1+047A ;P 1 BRK AT 00000690 X1+0490/CMPL R0,#000009A8 (14) ;B (15) 1 00000690 2 00000699 (16) 0,1;B (17) ;B (18) 2 00000699 (19) ;P (20) 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 O PID= 0004 LOGINTIME= 12:50:20.40 X1+049B/BRB X1+047A ;P (21) 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 ;P PID= 0005 LOGINTIME= 12:50:25.61 (22) 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 X1 4B9!CLRQ -(SP) (23) [Linefeed] (24) X1+04BB/CLRQ -(SP) [Linefeed] X1+04BD/PUSHL X1+002E [Linefeed] X1+04C1/PUSHAL X1+003A [Linefeed] X1+04C5/CLRQ -(SP) [Linefeed] X1+04C7/PUSHL #00 [Linefeed] X1+04C9/MOVZWL #0030;-(SP) [Linefeed] X1+04CE/MOVZWL X1+0012,-(SP) [Linefeed] X1+04D3/PUSHL #00 [Linefeed] X1+04D5/CALLS #0C,@#7FFEDE00 .;B (25) ;B (26) 1 000006D5 2 00000699 ;P (27) 1 BRK AT 000006D5 X1+04D5/CALLS #0C,@#7FFEDE00 ;P (28) PID= 0006 LOGINTIME= 12:50:29.45 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 ;P (29) 1 BRK AT 000006D5 X1+04D5/CALLS #0C,@#7FFEDE00 ;P (30) PID= 0007 LOGINTIME= 12:50:37.08 2 BRK AT 00000699 X1+0499/BSBB X1+04A2 O (31) 1 BRK AT 000006D5 X1+04D5/CALLS #0C,@#7FFEDE00 ;P (32) PID= 0008 LOGINTIME= 12:50:45.64 STEPOVER BRK AT 0000069B (33) X1+049B/BRB X1+047A ;B (34) 1 000006D5 2 00000699 (35) 0,2;B (36) 0,1;B (37) ;B (38) ;P (39) PID= 0009 LOGINTIME= 12:51:22.51 PID= 000A LOGINTIME= 12:51:30.26 PID= 000B LOGINTIME= 12:51:36.21 PID= 000C LOGINTIME= 12:51:58.86 (40) EXIT 00000001 (41) 80187E7E/POPR #03 EXIT (42) |
| Previous | Next | Contents | Index |