|
HP OpenVMS Delta/XDelta Debugger Manual
- The ;P command lets you proceed from the
breakpoint.
- Program execution halts at the first
breakpoint. DELTA displays the breakpoint message (Brk 1 at 00030164)
with the breakpoint number 1 and the virtual address. The virtual
address is 30164, which is the base address (30000) plus the offset
164. DELTA then displays the instruction in instruction mode (CMPEQ
R0,#X14,R16). The contents of the general register 0 are displayed with
the / command. DELTA displays the contents of R0, which is 1. Program
execution continues using the ;P command.
- The function print_line is executed, and the
output (PID, process name, and login time) is displayed.
- The O command halts program execution at the
instruction where the function returns control (BR R31,#XFFFFE1). (This
is the point at which control passes to checking the conditions of the
while loop.) Program execution continues with ;P.
- Breakpoint 2 is encountered. DELTA displays
the breakpoint message, and the instruction. The function is executed
with the O command and the function output is displayed. The next
instruction where the function returns control is displayed. Program
execution continues with the ;P command.
- Breakpoint 2 is encountered again. DELTA
displays the breakpoint message, and the instruction. The function is
executed with the O command and the function output is displayed. The
next instruction where the function returns control is displayed.
Program execution continues with the ;P command.
- Breakpoint 2 is encountered again. The
instruction at offset 84 (in print_line) is displayed using !. This
instruction is part of the setup for the call to the printf function.
B.2.3 DELTA Debugging Session Example on Alpha - Part 3
In the third part of the example session, successive address locations
are specified when the user presses Linefeed. Another breakpoint is
set, and program execution continues. DELTA stops at the break point,
and the ;O command is used to halt execution and step over a routine
call. Program execution continues through more breakpoints to a final
exit.
The callout list following the example provides details for this
example segment.
Example B-6 DELTA Debugging Session Example
on Alpha - Part 3 |
[Linefeed] (1)
X1+00000088! LDL R18,#X0010(FP) [Linefeed]
X1+0000008C! JSR R26,(R26) .;B (2)
;B
1 0003008C
2 000301AC
;P (3)
Brk 1 at 0003008C (4)
X1+0000008C! JSR R26,(R26) O
PID= 00000027 PRCNAM= JOB_CONTROL LOGINTIM= 16:24:06.83
X1+00000090! BIS R31,FP,SP ;P
Brk 2 at 000301AC
X1+000001AC! BSR R26,#XFFFF94 ;P
Brk 1 at 0003008C (5)
X1+0000008C! JSR R26,(R26) O
PID= 00000028 PRCNAM= NETACP LOGINTIM= 16:24:22.86
X1+00000090! BIS R31,FP,SP ;P
Brk 2 at 000301AC
X1+000001AC! BSR R26,#XFFFF94
;B
1 0003008C
2 000301AC
0,2;B
0,1;B
;B
;P
PID= 00000029 PRCNAM= EVL LOGINTIM= 16:24:26.67
PID= 0000002A PRCNAM= REMACP LOGINTIM= 16:24:38.21
PID= 0000002B PRCNAM= LATACP LOGINTIM= 16:24:43.18
PID= 0000004C PRCNAM= GODDARD LOGINTIM= 07:40:49.34
PID= 0000002D PRCNAM= SYMBIONT_0001 LOGINTIM= 16:25:47.54
PID= 0000002F PRCNAM= MCCORMICK LOGINTIM= 16:27:45.27 (6)
Exit 00000001 (7)
8002228C! ADDL R15,SP,SP EXIT (8)
|
- Successive address locations are displayed
by pressing the Linefeed key two times. These instructions are the
remainder of the setup and the call to printf.
- A breakpoint at X1+8C (the current address)
is set using the ;B command. This breakpoint is in the function
print_line. The . symbol represents the current address. Note that
breakpoint 1 was cleared earlier and is now reused by DELTA for the new
breakpoint.
- Program execution continues with the ;P
command.
- Program execution stops at the new
breakpoint 1, which is in the print_line function. DELTA displays the
breakpoint message and the instruction at the new breakpoint. The O
command halts program execution at the instruction where the function
returns control, stepping over the routine call. Note the O command
must be used in this case, as opposed to the ;P command, because the
printf function resides in read-only protected memory. Program
execution is continued with the ;P command.
- Program execution stops at breakpoint 1 in
the print_line function. Program execution is continued using a
combination of the O and ;P commands.
- 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.
Appendix C Sample DELTA Debug Session on VAX
This appendix provides an example of how you would use DELTA to debug a
program executing on OpenVMS VAX. The example program, named LOGINTIM,
uses the system service SYS$GETJPI to obtain the login times of each
process. To run the example program without error, you need WORLD
privilege.
Note
Although this example debugging session demonstrates using the DELTA
debugger, you could use most of the commands in the example in an
XDELTA debugging session as well.
|
This appendix consists of two sections:
- Section C.1 shows the source and machine listing files for the
example program
- Section C.2 shows the example DELTA debugging session and explains
the various commands used and information provided.
C.1 Listing Files for Example Program
This section shows the listing files for the example program, LOGINTIM,
in two parts:
See Section C.2 for the corresponding sample debugging session using
this program.
C.1.1 Source Listing for VAX Debugging Example
The .LIS file for the DELTA debugging example on OpenVMS VAX is shown
in Example C-1. Only the offsets and source code are shown.
Example C-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
|
C.1.2 Map File for VAX Debugging Example
The .MAP file is shown in Example C-2. Only the Program Section
Synopsis with the PSECT, MODULE, base address, end address, and length
are listed.
Example C-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.)
|
C.2 Example DELTA Debugging Session on VAX
The DELTA debugging session on OpenVMS VAX for the sample program is
shown in the four example segments that follow.
C.2.1 DELTA Debugging Session Example on VAX - Part 1
In the first part of the example session, DELTA is enabled and the
LOGINTM program is invoked. The example shows version information
displayed by DELTA and the use of the ;B and ;P commands.
The callout list following the example provides details for this
example segment.
Example C-3 DELTA Debugging Session Example
on VAX - Part 1 |
$ 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)
|
- 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.
C.2.2 DELTA Debugging Session Example on VAX - Part 2
In the second part of the example session, program execution begins.
DELTA halts at the first breakpoint and displays information. User
interaction allows DELTA to continue to the next breakpoint.
The callout list following the example provides details for this
example segment.
Example C-4 DELTA Debugging Session Example
on VAX - Part 2 |
;P (1)
1 BRK AT 00000690
X1+0490/CMPL R0,#000009A8 R0/00000001 ;P (2)
2 BRK AT 00000699
X1+499/BSBB X1+04A2 O (3)
PID= 0000 LOGINTIME= 00:00:00.00 (4)
X1+049B/BRB X1+047A ;P (5)
1 BRK AT 00000690
X1+0490/CMPL R0,#000009A8 R0/00000001 ;P (6)
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 O (7)
PID= 0001 LOGINTIME= 00:00:00.00
X1+049B/BRB X1+047A ;P
1 BRK AT 00000690
X1+0490/CMPL R0,#000009A8 (8)
;B (9)
1 00000690
2 00000699 (10)
|
- Program execution begins with the ;P command.
- 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.
C.2.3 DELTA Debugging Session Example on VAX - Part 3
In the third part of the example session, the first breakpoint is
cleared, then all breakpoints are listed. The program continues until
the next breakpoint is encountered, and the user sets a new breakpoint.
The callout list following the example provides details for this
example segment.
Example C-5 DELTA Debugging Session Example
on VAX - Part 3 |
0,1;B (1)
;B (2)
2 00000699 (3)
;P (4)
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 O
PID= 0004 LOGINTIME= 12:50:20.40
X1+049B/BRB X1+047A ;P (5)
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 ;P
PID= 0005 LOGINTIME= 12:50:25.61 (6)
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 X1 4B9!CLRQ -(SP) (7)
[Linefeed] (8)
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 (9)
;B (10)
1 000006D5
2 00000699
|
- 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.
C.2.4 DELTA Debugging Session Example on VAX - Part 4
In the final part of the example session, program execution continues
and stops at the new breakpoint set in the previous example segment.
DELTA executes the subroutine where the breakpoint was encountered and
displays the output. The next breakpoint is reached and the use enters
the ;O command to step over the subroutine. When there are no more
breakpoints, the program completes and final exit status is displayed.
The callout list following the example provides details for this
example segment.
Example C-6 DELTA Debugging Session Example
on VAX - Part 4 |
;P (1)
1 BRK AT 000006D5
X1+04D5/CALLS #0C,@#7FFEDE00 ;P (2)
PID= 0006 LOGINTIME= 12:50:29.45
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 ;P (3)
1 BRK AT 000006D5
X1+04D5/CALLS #0C,@#7FFEDE00 ;P (4)
PID= 0007 LOGINTIME= 12:50:37.08
2 BRK AT 00000699
X1+0499/BSBB X1+04A2 O (5)
1 BRK AT 000006D5
X1+04D5/CALLS #0C,@#7FFEDE00 ;P (6)
PID= 0008 LOGINTIME= 12:50:45.64
STEPOVER BRK AT 0000069B (7)
X1+049B/BRB X1+047A ;B (8)
1 000006D5
2 00000699 (9)
0,2;B (10)
0,1;B (11)
;B (12)
;P (13)
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 (14)
EXIT 00000001 (15)
80187E7E/POPR #03 EXIT (16)
|
- 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.
|