Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS Delta/XDelta Debugger Manual


Previous Contents Index

The .MAP file for the sample program is shown in Example B-3. Only the Program Section Synopsis with the psect, module, base address, end address, and length are listed.

Example B-3 .MAP File for the Sample Program

                                            +--------------------------+ 
                                            ! Program Section Synopsis ! 
                                            +--------------------------+ 
 
Psect Name      Module Name       Base     End           Length 
----------      -----------       ----     ---           ------ 
 
$LINKAGE                        00010000 000100FF 00000100 (        256.) 
                LOG             00010000 000100FF 00000100 (        256.) 
 
$LITERAL                        00010100 00010158 00000059 (         89.) 
                LOG             00010100 00010158 00000059 (         89.) 
 
$READONLY                       00010160 00010160 00000000 (          0.) 
                LOG             00010160 00010160 00000000 (          0.) 
 
$INIT                           00020000 00020000 00000000 (          0.) 
                LOG             00020000 00020000 00000000 (          0.) 
 
$UNINIT                         00020000 0002002F 00000030 (         48.) 
                LOG             00020000 0002002F 00000030 (         48.) 
 
$CODE                           00030000 0003027B 0000027C (        636.) 
                LOG             00030000 0003027B 0000027C (        636.) 
 

The DELTA debug session is shown in Example B-4.

Example B-4 DELTA Debugging Session of the Sample Program

 
$ DEFINE LIB$DEBUG SYS$LIBRARY:DELTA  (1) 
$ RUN/DEBUG LOG  (2) 
Alpha/VMS DELTA Version 1.5   (3) 
 
Brk 0 at 00030200    
 
00030200!    LDA         SP,#XFFD0(SP)  30000,1;X  
X1 164! CMPEQ           R0,#X14,R16  .;B (4) 
                                                             
 
X1 1AC! BSR             R26,#XFFFF94  .;B  (5)
 
;P
 
Brk 1 at 00030164    (6)
 
X1+00000164!    CMPEQ           R0,#X14,R16  R0/ 00000001 ;P   
 
Brk 2 at 000301AC
 
X1+000001AC!    BSR             R26,#XFFFF94  O    
 
        PID= 00000021           PRCNAM= SWAPPER LOGINTIM= 00:00:00.00  (7)
X1+000001B0!    BR              R31,#XFFFFE1  ;P  
 
Brk 1 at 00030164
 
X1+00000164!    CMPEQ           R0,#X14,R16  R0/ 00000001 ;P
 
Brk 2 at 000301AC    
 
X1+000001AC!    BSR             R26,#XFFFF94  O (8)
        PID= 00000024           PRCNAM= ERRFMT  LOGINTIM= 16:24:01.03
X1+000001B0!    BR              R31,#XFFFFE1  ;P
 
Brk 1 at 00030164
 
X1+00000164!    CMPEQ           R0,#X14,R16
 
;B
 1 00030164
 2 000301AC
 
0,1;B
 
;B
 2 000301AC
 
;P
 
Brk 2 at 000301AC   (9)
 
X1+000001AC!    BSR             R26,#XFFFF94  O
        PID= 00000025           PRCNAM= OPCOM   LOGINTIM= 16:24:02.56
X1+000001B0!    BR              R31,#XFFFFE1  ;P
 
Brk 2 at 000301AC    (10)
 
X1+000001AC!    BSR             R26,#XFFFF94  O
      PID= 00000026          PRCNAM= AUDIT_SERVER    LOGINTIM=16:24:03.66
X1+000001B0!    BR              R31,#XFFFFE1  ;P
 
Brk 2 at 000301AC  (11)
 
X1+000001AC!    BSR         R26,#XFFFF94 X1 84!  LDQ   R16,#X0040(R2) 
[Linefeed] (12)                            
 
 
X1+00000088!    LDL             R18,#X0010(FP)  [Linefeed]
 
 
X1+0000008C!    JSR             R26,(R26)  .;B (13)
 
;B
 1 0003008C
 2 000301AC
 
;P (14)
 
Brk 1 at 0003008C    (15)
 
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 (16)
 
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
Exit 00000001
 
8002228C!       ADDL            R15,SP,SP EXIT
 

  1. DELTA is enabled as the debugger.
  2. The example program LOG is invoked with DELTA.
  3. DELTA displays a version number and the first executable instruction. The base address of the program (determined from the map file) is virtual address 30000. 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+200 (or the base address 30000 + offset 200). Also, DELTA displays some address locations as offsets to the base address.
  4. The instruction at address 30164 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 164. (This is the point where the return status from SYS$GETJPIW is checked.) The base address in base address register X1 is 30000. The address reference, then, is X1+164. Note 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+164;B would have done the same thing.
  5. The same commands (! command to view the instruction and ;B to set a breakpoint) are repeated for the instruction at offset 1AC. (This is the point at which the print_line function is called.)
  6. 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.
  7. The function print_line is executed, and the output (PID, process name, and login time) is displayed.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. Program execution continues with the ;P command.
  15. 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.
  16. Program execution stops at breakpoint 1 in the print_line function. Program execution is continued using a combination of the O and ;P commands.


Index Contents

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
4540PRO_007.HTML