Command: debug

Syntax

debug

Description

A symbolic debugging window, for the interactively monitoring of Fire during execution. This facility is available on Microsoft Windows systems only.

Interaction with the debugger is available only when normal Fire processing is suspended. During this interaction, commands typed in the monitor window (in response to the Debug > prompt) are executed normally .

Only development versions of the system have this debugging facility.

Parameters

None

Switches

Dialog Interface

This command displays the interactive debug window. If the debug window is already displayed, no action is taken.

The debug window is divided vertically into 3 sections, and can be resized internally as well as externally by sashes handles:

Breaks Section

This section contains general information about when the debugger should stop macro code execution and give the operator the chance to debug his/her code. Such stop points are known as "break points" and can be set as follows:

When Fire issues an error message (known as the "Error Break").

When a break has been set at a particular line in a particular macro or function (known as a "Code Break").

When a command is executed which contains a particular text string (known as a "Text Command Break").

When a condition is true, e.g. testing the value of a language identifier (known as a "Conditional Command Break").

This section takes the form of a 5-sheet tab window:

General: This sheet contains 4 check-boxes, the first of which permits the Error Break to be set or unset, and the rest enable the other 3 break categories (details of which are managed by sheets Code, Text and Condition) to be enabled or disabled.

Code: This sheet contains some text boxes for the setting of Code Breaks in files or procedures. The bottom text box gives a list of current Code Breaks. Code Breaks can also be added/removed/conditionalized/suppressed interactively in the Flow Section during code debugging.

Text: This sheet contains details of Text Command Breaks. It allows the setting/removal/editing of Text Breaks, which can be literal or wild-card matched.

Condition: This sheet contains details of Condition Command Breaks. It allows the setting/removal/editing of Fire language conditions. When active, all conditions are tested before the execution of every executed Fire statement, which can slow processing down somewhat. These breaks should be used sparingly.

Save/Restore: This sheet enables the current set of breaks to be written to or retrieved from file. The created files have the extension .dbg.

Flow Section

This section contains information about the current executing command frame. It contains a row of push-buttons to control subsequent program flow once Fire has been told to resume, a text window showing the code of the currently executing command frame, and a single-line text box displaying the next Fire command to be executed when Fire is told to resume.

Consider the following image which is a snapshot of this section when Fire has been interrupted.

Fire has stopped at the ifyes line (shown in red) and is now waiting for one of the push-buttons to be clicked to resume execution. As you can see the command shown in the Current Command text box expands careted strings automatically.

This wait gives the operator the chance to add or remove break points, look at the the values of identifiers and so on. In this interrupted state, the Fire monitor window can be used to run enquiry commands.

A quick way of looking at identifier values is to highlight the offending identifier, and a tooltip will display its value.

A quick way to add remove a break is to right click in the main window on a particular line. This will display a popup window such as:

and you can add or remove a break point. This break point will also be added to the list of Code Breaks in the Breaks section. Break points are shown in the text window by various symbols to the left of the code:

Symbol

Meaning

Break point

Break point (suppressed)

Conditional break point

Conditional break point (suppressed)

2 other symbols may appear in the left margin as follows:

Symbol

Meaning

The next line scheduled for execution, which is typically
the line at which Fire has been interrupted

The code line which caused an Error Break

When you have finished debugging for the moment, you should tell Fire to resume execution by clicking one of the push buttons. The resume functionality of each button is as follows:

Button

Functionality

Step

Execute the current command then interrupt Fire again. If the current command begins a new command frame (e.g. a macro, function or procedure), execution will be interrupted at the first command within the new command frame

Next

Execute the current command then interrupt Fire again. If the current command begins a new command frame (e.g. a macro, function or procedure), the command frame is executed without stepping into it, unless their is a break point within that command frame

Run

Resume execution and continue running until the next break point is met, at which time Fire will be interrupted again

RunFrame

Resume execution and execute the remainder of the current command frame, then interrupt Fire again. If a break point is met between the current command and the end of the current frame the interruption is made at that break point.

Skip

Skip the current command (i.e. do not execute it) and stop at the next command.

Abort

Abort execution of the current command frame, leave the debugger and return to normal processing.

Status Section

This last section contains a text window and an information status bar.

The text window displays a command frame traceback when Fire has been interrupted. This traceback enables you to see the command frame hierarchy of what has called what to get to the current code position.

The status bar simply indicates whether Fire is currently running or interrupted.

An example of this section in an interrupted state is:

Example

Typically to debug a macro one would set break points in the debugger first then execute the macro, e.g. typed into the monitor window, or from an on-screen menu.

Alternatively, to stop at the first line of a macro, click the Step button in the Flow Section then run the macro.

See Also

Commands:

identbox

Identifiers:

echoing (numeric), stepping (numeric)