Debugging Programs

QA Build provides a facility for debugging programs. When you run a program using the debugger, the program is interrupted at regular intervals and its current state is displayed. At these points, you can check the values of all local and database fields used by the program. You may choose the frequency of the interruptions.

QAB Debug Screen

The QA Build debugging screen is shown above. Notice that under the program information several options are offered for the key entry. These allow you to determine the frequency of interruptions or to view and edit the current values of local and database fields.

Running the QA Build Debugger

To run the QA Build debugger, you use the program PROGRUND, which is a modified version of the QA Build Program Interpreter, PROGRUN.

  1. Either compile your QA Build program with the DEBUG command tail:
    PROGCOMP −DEBUG
    or
    From the QAB Menu compile your QA Build program using the Debugging Compiler

  2. Run the program using the debugger PROGRUND exactly as you would run with PROGRUN (using the same command tails)

    You can also run the debug compiled program with the standard Program Interpreter. It behaves as if it were compiled normally, except for a slightly increased load time

  3. Each time the program execution is interrupted you can specify the debug mode option:

    Debug
    Option
    Description
    X

    Exit program immediately

    B

    Specify procedure to start debug mode

    0

    No debugging

    1

    Procedure flow only

    2

    mode 1 + auto incrementing and map clearing

    3

    mode 2 + table access

    4

    mode 3 + field execution

    5

    Full debugging mode

    D

    View and edit database fields

    L

    View and edit local fields

    G

    View global variables

    When you select D or L, the fields defined so far in the program will pop up. Press <Enter> to modify the contents of the fields.

    The global variables are shown in the following format: