Debugging

Debugger and extended Debugger

XOTcl have two browsers suitable for debugging. Up from Version 0.39 XOTclIDE support an extended debugger based on atkdebugger. This debugger can be loaded into IDE as add-ins. (See the Section called Extended Debugger)

Debugger Browser

This Browser let you stop the program flow in one point and view calling stack method and local variables. To set a break point call halt method

[self] halt
# or
my halt
# or if not in XOTcl method
Object halt

Figure 9. Debugger

You can resume the program flow with button Resume or terminate the flow by exit the browser (close window).

The comfort function as stepping throw methods, setting break points per editor are implemented only in extended debugger.

Stack Error Browser

This browser is can parse the error stack info "errorInfo". XOTclIDE modify the bgerror method and add new button to standard error message (XOTclIDE browser). Tcl do not let to inspect the calling stack by errors. So there are all information that are possible by error. You can also view (Button errorInfo) the original errorInfo. The browser try to highlight the called methods. By extended debugger the error cause the invoking of debugger direkt in error place.

Figure 10. Error Stack Browser

Tracker Browser

This is a GUI for something like tracker known from XOTcl package xotcl::tracker. So you can track calls to every objects for chosen class. To Track some class select menu "Track Class" from Class Menu in Component Browser. You can customize the tracker to show

Figure 11. Mathod Calls Tracker

Variable access tracking and watching

XOTclIDE can be used to track read or write access on global variables or object variables. To add some track use variable menu in global variables browser or object inspector. The some selected access occurs the debugger will be invoked in access place. You can inspect in debugger the access context and resume the operation per button resume. The variables can be also watched in entry Tk widget link per -textvariable with chosen variable.

Figure 12. Variable Tracker and Variable Watch

In this screen-shoot are 4 tracked variables. By variable tk_library the debugger are invoked on every read access. There are also one XOTcl variable (object variable) objectVar from object c written in XOTcl style as ::c::objectVar. Local procedures variables can not be tracked or watched.

To add new tracks for chosen variable use Object Inspector or Global Vars Browser. For example Variables->Debug on Write Access to add write access track. You can have multiple tracks (read, write, watch) on one variable.

Warning

Watches on variables can prevent proper unset of variables. Therefore watches can influence program flow.