TixDebug Debugger

The Debugger:

The debugger window is divided into the main region with the name of the current proc, a listing in which the expression just executed is highlighted, the result of this execution and the currently available variables and their values, an entry to eval expressions in the context of the current proc and some controls for the state of the debugger.

A proc listing displayed in the main region will have a darker background on all lines that have been prepared. You can prepare or restore additional lines by selecting a region (<Button-1>, standard selection) and choosing `Prepare' or `Restore' from the Selection menu (or by pressing ^P or ^R).

`Prepare' and `Restore' try to be smart about what you intend to do. If you select just a single word (plus some optional whitespace) it will be interpreted as the name of a proc to prepare or restore. Otherwise, if the selection is owned by the listing, the corresponding lines will be used.

Be careful with partial prepare or restore! If you prepare random lines inside a `switch' or `bind' expression, you may get surprising results on execution, because the parser doesn't know about the surrounding expression and can't try to prevent problems.

There are seven possible debugger states, one for each button and a `waiting' state when no button is active. The others are:

Closing the debugger doesn't quit it, it only does `wm withdraw'. The debugger window will pop up the next time a prepared proc is called.

Breakpoints:

To set/unset a breakpoint, double-click inside the listing to select a region, then use the Edit Menu/Insert Breakpoint. The breakpoint will be set at the innermost available expression that contains the position of the selection.

The `Eval: ' entry supports a simple history mechanism available via the <Up> and <Down> keys. If you evaluate a command while stepping through a proc, the command will be evaluated in the context of the proc, otherwise at global level. The result will be displayed in the result field.

This entry is useful for a lot of things, but especially to get access to variables outside the current scope. Try entering the line `global td_priv' and watch the `Variables' box (with global and array variables enabled of course). For further information, select a topic from the list below: