 |
HP OpenVMS Delta/XDelta Debugger Manual
- A simple breakpoint is set in the main
routine at address 30040, just prior to the subroutine call.
- A simple breakpoint is set in the subroutine
at address 30070. The breakpoints are displayed using the ;B command.
- Program execution continues using ;P.
- Program execution stops at breakpoint 1.
DELTA/XDELTA displays the breakpoint message and the instruction at the
breakpoint address. The O command is used to single-step (DELTA/XDELTA
recognizes that this is not a call instruction and turns it into a
single-step instead).
- The next instruction is a subroutine call
(BSR). The subroutine is stepped over using the O command.
- Ordinarily, the step-over would continue
execution at the instruction following the subroutine call. However, in
this case, program execution stops at breakpoint 2 inside the
subroutine at address 30070. Program execution continues with the ;P
command.
- The subroutine completes execution.
DELTA/XDELTA displays a step-over break message that indicates that the
O command has been completed, returning control at address 30048.
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
|
- Program execution is currently at Base
Register X0, plus offset 00000380. The instruction at X0+380 is a Move
Application Register instruction. Step execution is then continued
using the S command.
- Program execution is stopped at Base Register
X0, plus offset 00000381. The instruction at offset 00000381 is a No
Operation instruction. Step execution is then continued using the S
command.
- Program execution is stopped at offset
00000382. The instruction at 00000382 is a "br.call" instruction.
Execution is continued using the O command, thus skipping the
routine(s) being called.
S (Step Instruction)
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.
Format
S
Description
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.
Examples
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.
' (Deposit ASCII String)
Deposits the ASCII string at the current address.
Format
'string'
Arguments
string
The string of characters to be deposited.
Description
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.
Example
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).
= (Display Value of Expression)
Evaluates an expression and displays its value.
Format
expression =
Argument
expression
The expression to be evaluated.
Description
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.
|
Example
FF+1=00000100 (1)
A-1=00000009 (2)
|
- FF16 and 116 are added
together. DELTA/XDELTA displays the sum in hexadecimal.
- 116 is subtracted from
A16. DELTA/XDELTA displays the result in hexadecimal.
\string\ (Immediate mode text display command) (Alpha and I64 Only)
Displays the ASCII text string enclosed in backslashes.
Format
\string\
Description
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.
Appendix A Sample DELTA Debug Session on VAX
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)
|
- DELTA is enabled as the debugger.
- The example program LOGINTIM is invoked with
DELTA.
- DELTA displays a version number and the first
executable instruction. The base address of the program (determined
from the map file) is virtual address 200. The base address is placed
in base register 1 with ;X. Now references to an address can use the
address offset notation. For example, a reference to the first
instruction is X1+464 (or base address 200 + offset 464). Also, DELTA
displays some address locations as offsets to the base address.
- DELTA displays the value in base register 1,
just loaded 200.
- The instruction at address 690 is displayed
in instruction mode using !. Its address location is expressed as the
base address plus an offset. In the listing file, the offset is 490.
The base address in base register X1 is 200. The address reference,
then, is X1+490. (Note that the + sign is implied when not specified.)
A simple breakpoint is set at that address using the ;B command.
The address reference for ;B is the . symbol, representing the current
address. X1+490;B would have done the same thing.
- The same commands (! command to view the
instruction and ;B to set a breakpoint) are repeated for the
instruction at offset 499. When DELTA displays the instruction (BSBB
GOT_IT), it displays the destination of the branch (GOT_IT) as the
address location. DELTA displays the value as an offset to base
register 1.
- Program execution is begun using ;P.
- Program execution halts at the first
breakpoint. DELTA displays the breakpoint message (1 BRK AT 00000690)
with the breakpoint number 1 and the virtual address. The virtual
address is 00000690, which is the base address (200) plus the offset
490. DELTA then displays the instruction in instruction mode (CMPL
R0,#000009A8). The contents of general register 0 are displayed with
the / command. DELTA displays the contents of R0, which is 1. Program
execution continues using the ;P command.
- Program execution halts at breakpoint 2.
DELTA displays the breakpoint message, then the instruction.
Step-instruction execution, excluding instructions in subroutines, is
initiated with O.
- The subroutine GOT_IT is executed, and the
output (PID and login time) is displayed.
- The O command halts program execution at the
instruction where the subroutine returns control (BRB LOOP). DELTA
displays the instruction in instruction mode (BRB X1+047A), where
X1+047A is the address of the first instruction in LOOP. Program
execution continues with ;P.
- Breakpoint 1 is encountered again; DELTA
displays the breakpoint message and the instruction. The contents of R0
are examined (/ command) and program execution continues (;P).
- Breakpoint 2 is encountered again; DELTA
displays the breakpoint message and the instruction. The subroutine is
stepped over again with the O command. The subroutine is executed, and
the output is displayed. The instruction where the subroutine returns
control is displayed. Program execution continues (;P command).
- Breakpoint 1 is encountered; DELTA displays
the breakpoint message and the instruction.
- All breakpoints in the program are listed
with the ;B command.
- DELTA displays the breakpoints (by
breakpoint number) and the address locations.
- Breakpoint 1 is cleared using 0,[breakpoint
#];B. (Never clear breakpoint 1 in XDELTA.)
- All breakpoints are listed again with ;B
command.
- DELTA displays breakpoint 2 (breakpoint 1
cleared).
- Program execution continues using the ;P
command.
- Breakpoint 2 is encountered; DELTA displays
the breakpoint message and the instruction. The subroutine is executed
with the O command and the subroutine output is displayed. The next
instruction where the subroutine returns control is displayed. Program
execution continues with the ;P command.
- Breakpoint 2 is encountered; DELTA displays
the breakpoint message and the instruction. Program execution continues
to the next breakpoint with the ;P command. The subroutine is executed,
and the subroutine output is displayed.
- Breakpoint 2 is encountered again; the
instruction at offset 4B9 (in the subroutine) is displayed using !.
This instruction is part of the setup for the call to the system
service $QIOW.
- Successive address locations are displayed
by pressing the Linefeed key nine times. These instructions are the
remainder of the setup and the call to the system service $QIOW.
- A breakpoint at X1+04D5 (the current
address) is set using the ;B command. This breakpoint is in the
subroutine. The . symbol represents the current address.
- The current breakpoints in the program are
listed. The new breakpoint is assigned breakpoint 1.
- Program execution continues with the ;P
command.
- Program execution stops at the new
breakpoint 1, which is in the subroutine GOT_IT. DELTA displays the
breakpoint message and the instruction at the new breakpoint. Program
execution continues with the ;P command.
- The subroutine completes and displays the
output, and program execution continues until breakpoint 2. DELTA
displays the breakpoint message and the breakpoint 2 instruction.
Program execution continues with the ;P command.
- Program execution stops at breakpoint 1 in
the subroutine. Program execution continues with the ;P command. The
subroutine is executed, and the output is displayed.
- Program execution stops at breakpoint 2. The
O command is entered to execute and step over the subroutine.
- Program execution stops at breakpoint 1 in
the subroutine. Program execution continues with the ;P command.
- The subroutine completes execution and
displays output. DELTA displays a STEPOVER break message to state that
the O command has been completed, returning control at address 69B (an
instruction in the main routine).
- The instruction where the subroutine returns
is displayed, and program execution is halted. The ;B command is
entered to display all current breakpoints.
- The two current breakpoints are listed.
- The command 0,2;B clears breakpoint 2.
- The command 0,1;B clears breakpoint 1.
- The ;B command is entered to display all
current breakpoints. Because all breakpoints have been cleared, DELTA
does not display any.
- Program execution continues with the ;P
command. Because there are no longer any breakpoints, the program
executes to the end.
- All current process login times are
displayed.
- Final exit status is displayed.
- The DELTA EXIT command is entered to
terminate the debugging session and leave DELTA.
|