Using Execution Control

Having entered the Debugger, the programmer often needs to execute the program again in order to see what actually happens.

The program can be controlled by establishing either breakpoints or execution steps before continuing execution, to specify that the Debugger should be reinvoked when a condition becomes true or when a number of statements have been executed.

Continue Execution (G)

The G command continues program execution.

Format

G [n]

Parameter(s)

n

The line number to continue execution at. If omitted, the current line number will be assumed.

Description

Once the G command is used, the program will continue execution until the next breakpoint or, if an execution step has been specified, until the specified number of lines have been executed. See the next section for more information on execution steps.

A linefeed (CTRL+J) is a synonym for the G command with no arguments—that is, it will continue execution at the current line number. The linefeed has the advantage that it does not need to be followed by ENTER in order to be interpreted.

CAUTION

The G command should not be used if the operator has entered the Debugger because of a fatal run-time error. Continuing execution after a fatal error may result in corrupted data structures. In such an instance, the operator should exit the Debugger immediately with the END or OFF command.

Setting an Execution Step (E)

The E command establishes or removes an execution step. An execution step is a number of lines to be executed before automatically re-invoking the Debugger:

Format

E [n]

Parameter(s)

n

Returns control to the programmer every n lines. If n is omitted or 0, turn off the previous E command.

Description

After enabling E, you can return to the program with the G command. With each n lines executed, the program will return to the Debugger with the current line number preceded by E. By using an execution step of 1, the program can be stepped through: the programmer can examine every source line before it is executed, thus tracing the action as it occurs.

While an execution step is in effect with E, breakpoints are disabled. The program will not stop at breakpoints until E has been disabled again.

Execution steps are global; that is, if the program enters a subroutine, the step remains unchanged.

Ignoring Breakpoints (N)

The N command specifies that the next n breakpoints should be ignored.

Format

N [n]

Parameter(s)

n

Bypass n breakpoints before returning control to the programmer. If n is omitted, bypass 1 breakpoint.

Description

Although breakpoints are ignored by using the N command, the trace table is still printed at each bypassed breakpoint if it is enabled. By using the N command, the user can monitor the sequence of execution and the values of trace variables at each breakpoint, without re-entering the Debugger. The trace table can be disabled with the T command.

The N command is global;  that is, if the program enters a subroutine, the N command will still be in effect.

See Also

Using the mvBASIC Debugger

Debugger Commands: Quick Reference

Fixing a Bug

A Sample Program

Entering the Debugger

Exiting the Debugger

Displaying and Changing a Variable

Accessing Source Code

Using Breakpoints and Tracing

Printing Output

Using the Return Stack