Previous Topic: Computation PhaseNext Topic: Assembler Considerations


Sample Online Debugger Session

To use the online debugger with a DC PL/I program, perform the following steps:

  1. Compile the program with the LIST, OFFSET, XREF STORAGE, and MAP compiler options before defining it to the DC system.
  2. Record breakpoint and storage displacements as explained in Computation Phase above.
  3. Initiate the debugger session by entering the DEBUG task code from DC; the DEBUG> prompt is displayed, indicating that the debugger is in control:
    ENTER NEXT TASK CODE:
    debug
    
    
    DEBUG>
    
  4. Indicate the program to be debugged by entering DEBUG followed by the program name; the debugger verifies the program name:
    DEBUG>
    debug pliprog
    
    DEBUG PLIPROG
    DEBUG> DEBUGGING INITIATED FOR PLIPROG VERSION 1
    DEBUG>
    
  5. Establish breakpoints by issuing the AT command, followed by $, which signifies the base register, followed by the previously computed breakpoint address; the debugger verifies the establishment of the breakpoint:
    DEBUG>
    at $ + @a9a
    
    AT @A9A
    AT> @A9A ADDED
    DEBUG>
    
  6. After all breakpoints have been set, leave the setup phase of the debugger session by issuing the EXIT command:
    DEBUG>
    exit
    
  7. Initiate the run-time phase by issuing the task code that invokes the task that the program participates in:
    ENTER NEXT TASK CODE:
       deptmod
    
  8. When a breakpoint is encountered at run time, the debugger assumes control and identifies the address, program, and the debugger expression that was used to establish the breakpoint:
    AT OFFSET @A9A IN PLIPROG EXPRESSION @BDE
    DEBUG>
    
  9. You can now examine program variable storage by issuing LIST commands; indirect addressing is used based on the previously noted register and offset:
    list %:r13 + @31c 32
    
    LIST %:R13 + @31C 32
    001DB7F4  F3F2F0F0 F0F0F0F4 C8C5D9C2 C5D9E340 *32000004HERBERT *
    001DB804  4040C3D9 C1D5C540 40404040 40404040 *  CRANE         *
    

    If your program contains any nested procedures or begin blocks, you will need to navigate the chain of dynamic storage areas (DSAs) to obtain the correct variable-storage base address. To navigate the DSA chain for nested procedures or begin blocks, list the contents of register 13 to determine the DSA for the current level of nesting:

    list %:r13
    
    LIST %:R13
    001C7A30  84200000 001C7948 00000000 5E422A20 *D...........
    ...*
    

    For subsequent levels of nesting, perform the following step:

    1. List the absolute address contained 4 bytes off of the previously displayed line:
      list @1c7948
      
      LIST @1C7948
      001C7948  84200000 001C74D8 00000000 4E4227EC *D......Q....+...*
      
    2. When you have reached the final level of nesting, use the address 4 bytes off of the display as the base address to list AUTOMATIC variable-storage values:
      DEBUG>
      list 1c74d8 + @31c 32
      
      LIST 1C74D8 + @31C 32
      001C77F4  F3F2F0F0 F0F0F0F4 C8C5D9C2 C5D9E340 *32000004HERBERT *
      001C7804  4040C3D9 C1D5C540 40404040 40404040 *  CRANE         *
      

    To examine variables defined as BASED storage, perform the following steps:

    1. Using indirect addressing, list the contents of the associated pointer variable:
      DEBUG>
      list %:r13 + @d4
      
      LIST %:R13 + @D4
      001499E0  00149AC8 00000000 00000000 00000000 *...H............*
      
    2. List the absolute address to display the BASED variable's values:
      DEBUG>
      LIST @149ac8 16
      00149AC8  F1F1F1F1 C4C5D7E3 00000000 00000000 *1111DEPT........*
      
  10. To continue program execution, enter the RESUME command:
    DEBUG>
    resume
    
  11. To end a debugger session, enter the QUIT command from the DEBUG> prompt:
    DEBUG>
    quit
    
    QUIT
    QUIT DEBUGGER
    ENTER NEXT TASK CODE: