Debugging programs that use VPLUS

Debugging programs that use VPLUS is tricky because debugger I/O and VPLUS I/O cannot share the same terminal session. A common way to work around this problem is to use two terminal sessions, one to host debugger output and one to host VPLUS I/O. In the application of this method, the first terminal session hosts debugger output and establishes a FILE equation that directs VPLUS output to a second terminal session. This is the strategy we recommend you use when you want to debug an ACUCOBOL-GT program that uses VPLUS.

Note: You do not need to use two terminal sessions if the program you want to debug does not use VPLUS. Before you can use the source-level debugger on any program, you must compile the program with the "Gd" option.

The following steps describe one way to start your program so that debugger I/O will go to one terminal session and VPLUS I/O will go to another:

  1. Get a logical device number for the session that will host the VPLUS I/O.
    1. Establish a serial connection to the HP e3000 that has the qualities of a directly connected terminal (e.g.: a DTC, modem connection, modem connection from a terminal emulator, etc.).
    2. Get the logical device number (LDEV) of the connection. The LDEV will be used later in the FILE equation that redirects VPLUS I/O to this logical device. You can use the SHOWME command to get the LDEV number. For example:
      $STDIN LDEV: 90    $STDLIST LDEV: 90

      Make a note of the LDEV number. In the above example, the LDEV number is 90.

    3. Log out of the session (VPLUS cannot use the connection if it is already in use).
  2. Open a session for the ACUCOBOL-GT debugger. The connection type does not matter; the connection can be from a terminal emulator.
  3. In the debugger session, set a FILE equation that points to the VPLUS terminal filename that is specified in the VOPENTERM call and set the DEV number to the LDEV number derived from step 1. For example:
  4. Start the ACUCOBOL-GT debugger by including the "-d" option before the name of the program. For example:
    :RUN /ACUCOBOL/bin/runcbl;INFO="-d VPLUSP" 
  5. Use the debugger to debug your program.

When you use the debugger, the runtime switches into block mode before calling a VPLUS intrinsic and then back into raw mode after the call completes. This is done because the runtime requires raw mode when using the debugger. When the runtime is in block mode you will not be able to use COBOL DISPLAY/ACCEPT statements, nor will runtime errors be displayed on the screen. To capture runtime error messages, you should use the "-le" runtime option to send error messages to a file.

Some VPLUS calls may cause the keyboard to become locked when using the debugger. If this happens, you must use the appropriate commands for your terminal to unlock the keyboard.