Watch pane

The Watch pane displays the current values of data members that you want to track. Each time your program's execution pauses, the debugger evaluates all the items listed in the window and updates their displayed values.

To display the Watch pane, click the Watch tab while you are debugging. The Watch pane displays as a single large pane on the left of the AppBrowser. This is actually two panes; drag the split bar up to reveal the lower pane.

By default, this pane is set to display watch values. To configure a pane to view other information, right-click and choose Properties. The Context Tree Properties dialog box is displayed.

A watch monitors the changing values of variables or expressions during your application run. As your application runs, the value of the watch changes as your application updates the values of the variables contained in the watch expression.

If the execution point moves to a location where any of the variables in the watch expression are out of scope, then the entire watch expression becomes undefined. If the execution point returns to a location where the watch expression can be evaluated, then the Watch pane again displays the current value of the watch expression.

You can add, edit, delete, enable, and disable watches using the Watch pane popup menu.

Viewing a Watch pane

Another, recommended way to view a watch pane is to choose View|Debugger Context Browser. Right-click and choose Properties to configure the resulting window as a Watch window. In the AppBrowser, leave the Debugger tab selected. With this approach, you can keep viewing the Threads and Stack pane and the Data pane, while also seeing the watch information.

Watches, inspectors, and the current context

Watches are evaluated in the current context. This is different than inspectors, which are evaluated in the context used when the inspector was created.

See also:
Building Applications with JBuilder: Watching expressions