top
products_top_active company_top_inactive right_margin_top
zero_bugs_logo

Setting Breakpoints

To set a code breakpoint, go to the Breakpoints menu, then New Breakpoint. In the entry dialog, type either the fully qualified name of a function, or an address.

Another way of setting a breakpoint is to right-click on a line of code and select Insert Breakpoint from the popup menu.

Modifying Breakpoints

Activate the right-click menu on a line of code where a breakpoint exists. Select either Remove Breakpoint or Disable Breakpoint.

An alternative way of deleting and disabling breakpoints is to select Edit from the Breakpoints menu; A dialog box that contains a list of all breakpoints pops up. Select the breakpoints that you want to modify, then right-click on the list. A popup menu will present you with the Disable and Remove options. The menu options apply to all selected breakpoints. Press the OK button at the bottom of the dialog box to commit the changes.

Conditional Breakpoints

The debugger supports specifying conditions for breakpoints. Conditions are specified as C++ expressions that are evaluated in the scope of the breakpoint. The debugger will stop the debugged program at the location of the breakpoint only if the logical condition is met.

To specify the activation condition for a breakpoint, select Edit from the Breakpoints menu, and select the desired breakpoint from the list. This will enable the bottom part of the dialog, where you can enter the conditions. Hit OK when done. Please note that the changes are not committed if you close the dialog without hitting OK. The bottom part of the dialog is enabled only when exactly one selection is made in the list of breakpoints.

Some bugs may happen only after N iterations through a loop. It is useful to be able to specify the number of hits as a condition for activating a given breakpoint. You can use the Activate after ... hits feature to this purpose. The number of hits can be reset by hand (press the Reset button) or automatically, after the threshold value is met (use the Auto-reset check box).

If auto-reset is not specified, then the breakpoint will fire every time once the threshold condition is met. Auto-reset downs the hit count back to zero after the threshold is met. By specifying a threshold and auto-reset, you are telling the debugger to activate a breakpoint every N times.

If both a conditional expression and a hit threshold are specified, then hits are counted only when the expression yields true.

Note: Expressions that yield void evaluate to false.

Note: An interesting use for the conditional breakpoints is to test a small patch without having to rebuild the debugged program. Consider, for example, that you have a theory that some bug may be caused by an uninitialized variable. You can insert a breakpoint and enter i = 0 as the condition (or (i = 0) || 1 if you want the debugger to stop at the breakpoint). The code will be invoked every time the breakpoint is reached, and thus patch the debuggee on-the-fly. If you need to initialize the value to something else than zero, but do not wish the debugger to stop at the breakpoint, use the expression (i = 42) && 0.

Note: The conditional expression is not validated when entered in the dialog. If any error occurs at evaluation-time, the debugger will stop at the breakpoint.


intro documentation_stroke features sshots credits right_bottom

Home | Top | Up | Previous | Next | Community