Previous Topic: Preliminary Computations


Sample PL/I Online Debugger Session

To use the online debugger with a DC/UCF 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/UCF system.
  2. Record breakpoint and storage displacements, as explained above.
  3. Initiate the debugger session by entering the DEBUG task code from the DC/UCF system. The DEBUG> prompt displays indicating that the debugger is in control:
    ENTER NEXT TASK CODE:
    debug
    
    DEBUG>
    
  4. Specify 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 a dollar sign, which signifies the address of the beginning of the program; follow the dollar sign with the command's hexadecimal offset. The debugger verifies the establishment of the breakpoint:
    DEBUG>
    at $ + @a9a
    
    AT @A9A
    AT> @A9A ADDED
    DEBUG>
    

    After all breakpoints have been set, leave the setup phase of the debugger session by issuing the EXIT command:

    DEBUG>
    exit
    
  6. Initiate the runtime phase by issuing the task code that invokes the task in which the program participates:
    ENTER NEXT TASK CODE:
    deptmod
    

    When a breakpoint is encountered at runtime, 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>
    
  7. Examine program variable storage by issuing LIST commands. Use indirect addressing and 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 steps:

    1. List the absolute address which is located 4 bytes off of the previously displayed line:
      list @1c7948
      
      LIST @1C7948
      001C7948  84200000 001C74D8 00000000 4E4227EC *D......Q....+...*
      
    2. List AUTOMATIC variable-storage values after the final level of nesting has been reached. Use the absolute address as the base address, which is located 4 bytes off of the display:
      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. List the contents of the associated pointer variable using indirect addressing:
      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........*
      
  8. Enter the RESUME command from the DEBUG> prompt to continue program execution:
    DEBUG>
    resume
    
  9. Enter the QUIT command from the DEBUG> prompt to end a debugger session:
    DEBUG>
    quit
    
    QUIT
    QUIT DEBUGGER
    ENTER NEXT TASK CODE: