Previous Page | Next Page

The SCL Debugger

SCL Debugger Commands by Functional Category

The following sections briefly describe the commands that are available in the SCL debugger. For detailed information about a command, see its corresponding dictionary entry later in this chapter.


Controlling Program Execution

While you are in a debugger session, you can use the following commands to monitor the flow of the program and even to change the way the program executes:

GO

continues program execution until a specified statement or until the next breakpoint (if any) or program is finished.

JUMP

restarts program execution at a specified executable statement. This command causes the interpreter to bypass execution of any intermediate statement.

STEP

steps through the program statement by statement. By default, the ENTER key is set to STEP.


Manipulating Debugging Requests

The following debugger commands enable you to set breakpoints, tracepoints, and watched variables, which you can then use to suspend or trace the execution so that you can further manipulate the program variables. Whenever a debugging request is set, it remains in effect until you use the DELETE command to delete it.

BREAK

sets a breakpoint at a particular executable program statement. When a breakpoint is encountered, execution of the program is suspended and the cursor is placed on the DEBUG prompt line in the debugger MESSAGE window.

DELETE

removes breakpoints, tracepoints, or watched variables that were previously set by the BREAK, TRACE, and WATCH commands.

LIST

displays all the breakpoints, tracepoints, and watched variables that have been set by the BREAK, TRACE, and WATCH commands.

TRACE

sets a tracepoint. When a tracepoint is encountered, the debugger prints the information in the debugger MESSAGE window and continues processing.

WATCH

sets a watched variable. If the value of the watched variable is modified by the program, the debugger suspends execution at the statement where the change occurred, and it prints the old and the new values of the variable in the debugger MESSAGE window. This command is especially useful in large programs to detect when the value of a particular variable is being modified.


Manipulating Variables

When program execution is suspended, the debugger allows you to examine the values and attributes of variables. If the value of a variable would result in a logic error, you can then modify it so that you can continue the debugging session. Use these commands to manipulate SCL variables from the debugger:

ARGS

displays the values of arguments that are passed into the current program through the ENTRY statement.

CALCULATE

acts as an online calculator by evaluating expressions and displaying the result. This is useful when you try to set the value of a variable to the result of an expression. You can use SCL functions and dot notation in CALCULATE expressions.

DESCRIBE

displays the name, type, length, and class attributes of a variable.

EXAMINE

displays the values of one or more variables. You can use SCL functions with EXAMINE. You can also use dot notation to display values of object attributes and values that are returned by methods.

PARM

displays the values of parameters that you are passing if the next executable statement contains a function call.

PUTLIST

displays the contents of an SCL list.

SET

changes the value of a variable in the SCL program. This enables you to continue the debugging session instead of having to stop, modify the source, and recompile the program. You can also assign new values to variables in other active entries.


Expanding Macros and Macro Variable References

When program execution is suspended, the debugger can expand macros and macro variable references.

MACEXPAND

displays expanded macro invocations and macro variable references. The text of the macro or the value of the macro variable is displayed in the debugger window.


Controlling the Windows

The following commands manipulate the debugger windows:

ENVIRONMENT

enables you to set a developer environment by redisplaying the source of any program in the execution stack. When a developer environment is set, the debugger generates messages that show you what the current program environment and the developer environment are. You can then scroll through the source program, set debugging requests, and operate on the variables.

HELP

displays information about debugger commands.

QUIT

terminates a debugger session.

SWAP

switches control between the debugger SOURCE and MESSAGE windows.

TRACEBACK

displays the execution stack, which contains information about which entries are running.


Customizing the Debugger Session

The following commands enable you to customize your debugging sessions:

ENTER

enables you to assign one or more frequently used commands to the ENTER key. The default for ENTER is STEP, which steps through the program statement by statement.

IF

enables you to conditionally execute other commands.

Previous Page | Next Page | Top of Page