Setting and Removing Breakpoints
Related topics
Code Debug CICS uses breakpoints to pause program execution during the debugging process. You can set a breakpoint in a program either just before or just after the statement is executed using any of the following procedures:
- By primary command (AFTER, BEFORE, COUNT, RUNTO, and SKIP) on any screen
- By line command on the Source Listing screen (2.L)
- By statement number on the List Breakpoints screen (1.1)
- By offset on the List Breakpoints screen (1.1).
Each of these screens allow you to set either conditional, unconditional, or multiple breakpoints during program execution.
- A conditional breakpoint is set with an IF clause that provides Code Debug CICS with selection criteria. Code Debug CICS processes these criteria and stops execution only if they are met.
- An unconditional breakpoint always stops program execution if the instruction is executed.
- Multiple breakpoints (such as an after breakpoint and a before breakpoint set on the same statement) stop both before and after statement execution.
Setting Breakpoints by Primary Command
You can set breakpoints using the following primary commands on any screen in Code Debug CICS:
- AFTER — sets a breakpoint after the execution of a statement.
- BEFORE — sets a breakpoint before the execution of a statement.
- COUNT — sets a counter and monitors execution frequencies.
- INTERCEPT — loads a program or statically-linked subroutine within the program, then sets a before breakpoint at the entrypoint of the specified program or subroutine.
- RUNTO — sets a one-time breakpoint before the execution of a statement.
- SKIP — temporarily bypasses execution of a statement.
Setting Breakpoints by Line Command
On the Source Listing screen (2.L), you can set breakpoints using the following line commands:
- A (Unconditional After)
- AC (After Conditional)
- B (Unconditional Before)
- BC (Before Conditional)
- C (Count)
- Z (Runto, a one-time Unconditional Before)
- S (Skip).
Setting Breakpoints by Statement Number
Breakpoints can be set by statement number through the List Breakpoints screen (1.1) (or on any screen using a primary breakpoint command). To set a breakpoint in the program by statement number, type a statement number in any line in the statement area of the screen. Code Debug CICS sets a breakpoint at that statement. The following conditions apply:
- If the statement number is not an executable statement, Code Debug CICS sets the breakpoint at the first verb in the next executable statement.
- If the statement number is prior to the first executable statement, Code Debug CICS sets the breakpoint at the first executable statement in the program.
- If the statement number is higher than the last statement in the program, Code Debug CICS sets the breakpoint at the last executable statement in the program.
After entering the statement numbers to indicate the placement of breakpoints, press Enter. If source code is available, Code Debug CICS displays the source statement associated with each statement where a breakpoint is set.
Setting Breakpoints by Offset
Breakpoints can be set by offset through the List Breakpoints screen (1.1) (or on any screen using a primary breakpoint command). To set a breakpoint in the program by offset, type a plus sign (+) followed by the hexadecimal offset on any line in the statement area of the screen. Breakpoints can be set by offset for Assembler, C, COBOL, and PL/I programs. The following conditions apply only if a source listing is available.
- If the breakpoint is in the executable code for the program, Code Debug CICS sets the breakpoint at that offset.
- If the offset is prior to the first executable statement, Code Debug CICS sets the breakpoint at the first executable statement in the program.
- If the offset is past the end of the program, Code Debug CICS sets the breakpoint at the last executable statement in the program.
After entering the offset, press Enter. If source code is available, Code Debug CICS displays the source statement associated with each statement and offset.
Setting Multiple Breakpoints
You can set multiple breakpoints on a single statement from the Source Listing screen (2.L). The rules for setting multiple breakpoints are as follows:
- Set after and before (or runto) breakpoints and counts on the same statement.
- Set a count and a skip on the same statement.
- Skips take precedence over after and before (or runto) breakpoints. For example, if a skip is set on a statement that already has an after and/or before (or runto) breakpoint, the after and before (or runto) breakpoint are deleted.
Deleting Breakpoints
Breakpoints can be deleted by entering the D line command in the STMT field of the line that contains the statement or offset. To individually remove a breakpoint when multiple breakpoints are set on a line, type a D followed by the breakpoint to be removed. For example, if both a before and after breakpoint are set on one line, DA (Delete After) would remove only the after breakpoint and leave the before breakpoint active. To remove all breakpoints in a program, use the RELEASE primary command or the Resource Summary screen (1.P). The DELETE primary command can also be used to remove breakpoints from any Code Debug screen.
Retaining Breakpoints When Loading a New Copy of a Program
Under certain conditions, breakpoints can be retained when Code Debug CICS is used to load a new copy of a program. For more information, see NEWCOPY-Function.