Version 4.2.6 for Mainframes (Update)
 —  Debugger  —

Breakpoint Maintenance

A breakpoint causes the execution of a Natural object to be interrupted at a specific statement line. This section describes how and when to set breakpoints. Note that the maintenance functions described here may also be invoked from an object source by using the List object source function.

Start of instruction setTo invoke Breakpoint Maintenance

This section describes conditions for using breakpoint maintenance, the functions provided in the Breakpoint Maintenance menu and the fields and columns contained in a breakpoint screen.


Conditions of Use

A breakpoint is set by specifying the name of the Natural object to be processed and the line number in the object's source code where the breakpoint is to be executed.

Once a breakpoint has been specified, it remains set for the entire Natural session, unless you delete it.

A breakpoint refers to a specific line number in source code. A subsequent change of the source code itself may therefore lead to the breakpoint no longer applying to the desired statement, and thus the Natural object not being interrupted at the desired position. To circumvent this problem with program loops, labels can be set within these loops. Breakpoints set for these labels are adjusted to the correct line number if statement lines are inserted or deleted.

The unique identifier for a breakpoint is the spy number as assigned by the debugger.

Breakpoints cannot be set on comment lines, on any statement line other than the first one (if a single statement occupies more than one program line), and on lines that contain one of the following statements only:

Whether it is possible or not to set breakpoints for lines compiled with the Natural Optimizer Compiler depends on the NODBG option of the OPTIONS statement described in Switching on the Optimizer Compiler in the Natural Optimizer Compiler documentation.

Top of page

Set Test Mode ON/OFF

See the section Switch Test Mode On and Off.

Top of page

Activate Breakpoint

Start of instruction set To set the current state of specified breakpoints to active

Top of page

Deactivate Breakpoint

Start of instruction set To set the current state of specified breakpoints to inactive

Top of page

Delete Breakpoint

Start of instruction set To delete specified breakpoints

Top of page

Display Breakpoint

Start of instruction set To display a breakpoint

Start of instruction set To list breakpoints

Top of page

Modify Breakpoint

Start of instruction set To modify a breakpoint

  1. In the Breakpoint Maintenance menu, enter function code M, an object name and a line number. If you do not enter an object name, the default object (if specified) is used.

    Or:
    Use the direct command MODIFY, the syntax of which is described in the section Command Summary and Syntax.

    If a unique breakpoint has been specified, the Modify Breakpoint screen appears where you can change the field entries. The fields on the Modify Breakpoint screen are described in Fields and Columns on Breakpoint Screens.

    If no unique breakpoint is found, the List Breakpoints screen (see Display Breakpoint) appears.

  2. When you have finished editing the breakpoint definitions, choose PF3 (Exit) or PF5 (Save) to save any modification. See also Maintenance and Validation for information on validity checks of debug entries. If you choose PF12 (Canc), the breakpoint remains unchanged.

Top of page

Set Breakpoint

Start of instruction set To add a breakpoint for a session

Top of page

Fields and Columns on Breakpoint Screens

The fields contained in a Display Breakpoint or a Modify Breakpoint screen and the columns of a List Breakpoints screen are described in the following table:

Field Column Explanation
Test Mode    Indicates whether test mode is set to ON or OFF.
Object    Displays the name of the default object (see Start the Debugger) if specified.
   Co Input field for any of the following line commands:
AC   Activate breakpoint
DA Deactivate breakpoint
DI Display breakpoint
MO Modify breakpoint
DE Delete breakpoint
? List valid line commands
. Exit breakpoint screen
Spy number No. A unique number assigned by the debugger when setting the breakpoint.
Initial state Stat I Specifies the initial state and the current state of the breakpoint: active (A) or inactive (I).
Current state Stat C
Breakpoint name BP Name The name of the breakpoint.

Valid values: 1 to 12 characters.

The default name for a breakpoint consists of the object name and the line number.
DBID/FNR DBID The database ID (DBID) and file number (FNR) of the system file where the Natural object is stored.
FNR
Library Library The name of the library that contains the object.
Object name Object The name of the object available in the current library or one of its steplibs.
Line number Line The line number of a statement in the object source code. See also Conditions of Use above.

You can also specify BEG, END or ALL as line numbers:

BEG Specifies the breakpoint that is to interrupt program execution at the first statement executed in an object.
  BEG breakpoints cannot be specified for copycode.
END Specifies the breakpoint that is to interrupt program execution at the last statement executed in an object, for example, an END or a FETCH statement.
  END breakpoints cannot be specified for copycode.
ALL Specifies that a breakpoint is to interrupt program execution at each program line that contains an executable statement.
Label   Refers to a label set earlier in the source code of an object for statements that define processing loops: see also Conditions of Use above.

Valid values: 1 to 32 characters.

Skips before execution Skips Determines that the breakpoint is not to be executed until the corresponding statement line has been executed a certain number of times.

Valid values: 0 (default) to 32767.

Max number executions Execs Any value greater than zero (0) determines the maximum number of breakpoint executions.

Valid values: 0 (default) to 32767.

Number of activations Count Indicates how many times a breakpoint was activated for the relevant statement line.

The counter is reset when a program is started at Level 1.

Error in definition E Indicates that the statement line in the breakpoint definition cannot be found in the cataloged object during program execution.

This error can be caused if the source of an object is changed and recataloged during debugging.

Commands   Up to six debug commands. Enter one command per line. For a summary of all available commands, see Command Summary and Syntax.

Caution:
If you delete the command BREAK when modifying a breakpoint and you do not enter any command that issues a dialog, there is no way for the debugger to receive control during program interruption.

Top of page