Breakpoints

Breakpoints can be set on the tab of the same name. When a breakpoint is set, the execution of a script stops where the breakpoint was set. Note that breakpoints are shown only after updating the tree view . The breakpoints are created according to line numbers, the breakpoint "29", for example, means a breakpoint on the line 29. A click on the breakpoint jumps to the line where the breakpoint was set. If the script is selected in the tree view (see figure below), the first line of the script is selected. You can also search for breakpoints. See description of the search function. You can also add bookmarks to the breakpoint area - for more information, see chapter Script Editor - Add Bookmarks.

Figure 1. Breakpoints in the tree view
Figure 2. Searching for the breakpoint 25
Figure 3. Conditional breakpoint and ignore count

Conditional breakpoint

A breakpoint can use a condition that must be evaluated to a "bool true" value so that the thread for this breakpoint is stopped.

  • A condition can be any CTRL statement with a Boolean return value (e.g. "a > 5" or "(a > 5) && (b < 10)" or "object.str.isEmpty()" or "object.func()"), including function calls. Functions of the CTRL class can also be called.

  • The condition runs in the context of the line in which the breakpoint is located and therefore has access to all variables that are valid at this position (e.g. nested local variables).

  • A condition can access all members of the CTRL class, regardless of their access restrictions (protected, private).

  • A condition can also change variable values. For example, "x = 12" is not only an assignment, but also a condition, as the return value always corresponds to the assignment, i.e. 12

Restrictions:

Waiting function calls cannot be used (e.g. dpGet(), delay(), etc.).

The handling of exceptions is not possible (no try/catch/finally is allowed)

Synchronized handling is not possible

Code that is executed in a condition cannot be traced (CTRL_TRACE) and the breakpoint is not checked. This means that the code could have another breakpoint set, which is only hit during normal execution, but not during execution during condition evaluation.

ignoreCount

The ignoreCount of a breakpoint defines the number of hits that a breakpoint must make before a thread is actually stopped. If a breakpoint also contains a condition, the condition must be true in order to be counted as a hit.

Enable/disable/delete breakpoints

Breakpoints can now be enabled, disabled or deleted by right-clicking on a breakpoint in the breakpoint dock panel using the context menu that appears.

Right-clicking on a breakpoint in the source widget also displays a context menu for activating/deactivating the breakpoint. A deactivated breakpoint is never hit.

Continue to a line

The context menu in the source code widget can display Continue to this line when right-clicking within the breakpoint area if the currently displayed script is in a currently paused thread. This action sets a temporary breakpoint in this line and deletes this automatically as soon as it is hit. Note that:

  • temporary breakpoints can only be set in a line in which no other breakpoint has yet been set

  • temporary breakpoints are not retained