OpenBoot 2.x Command Reference Manual

The Forth Source-level Debugger

The Forth Source-level Debugger allows single-stepping and tracing of Forth programs. Each step represents the execution of one Forth word.

The debugger commands are shown in Table 6-4.

Table 6-4 Forth Source-level Debugger Commands

Command 

Description 

c

"Continue". Switch from stepping to tracing, thus tracing the remainder of the execution of the word being debugged. 

d

"Down a level". Mark for debugging the word whose name was just displayed, then execute it. 

f

Start a subordinate Forth interpreter. When that interpreter exits (with resume), control returns to the debugger at the place where the F command was executed.

q

"Quit". Abort the execution of the word being debugged and all its callers and return to the command interpreter. 

u

"Up a level". Un-mark the word being debugged, mark its caller for debugging, and finish executing the word that was previously being debugged. 

debug name

Mark the specified Forth word for debugging. Enter the Forth Source-level Debugger on all subsequent attempts to execute name. After executing debug, the execution speed of the system may decrease until debugging is turned off with debug-off. (Do not debug basic Forth words such as ".".)

debug-off

Turn off the Forth Source-level Debugger so that no word is being debugged. 

resume

Exit from a subordinate interpreter, and go back to the stepper (see the F command in this table).

stepping

Set "step mode" for the Forth Source-level Debugger, allowing the interactive, step-by-step execution of the word being debugged. Step mode is the default. 

tracing

Set "trace mode" for the Forth Source-level Debugger. This traces the execution of the word being debugged, while showing the name and stack contents for each word called by that word. 

<space-bar>

Execute the word just displayed and proceed to the next word. 

Every Forth word is defined as a series of one or more words that could be called "component" words. While debugging a specified word, the debugger displays information about the contents of the stack while executing each of the word's "component" words. Immediately before executing each component word, the debugger displays the contents of the stack and the name of the component word that is about to be executed.

In trace mode, that component word is then executed, and the process continues with the next component word.

In step mode (the default), the user controls the debugger's execution response. Before the execution of each component word, the user is prompted for one of the keystrokes specified in Table 6-4.