Watchpoints

You can make the program stop as soon as some variable value changes, or when some variable is read or written. This is called Illegal HTML tag removed : setting a watchpoint on a variable.18

Watchpoints have much in common with breakpoints: in particular, you can enable and disable them. You can also set conditions, ignore counts, and commands to be executed when a watched variable changes its value.

Please note: on architectures without special watchpoint support, watchpoints currently make the program execute two orders of magnitude more slowly. This is so because the inferior debugger must interrupt the program after each machine instruction in order to examine whether the watched value has changed. However, this delay can be well worth it to catch errors when you have no clue what part of your program is the culprit.

  • Setting Watchpoints:
  • Editing Watchpoint Properties:
  • Editing all Watchpoints:
  • Deleting Watchpoints:

Node:Setting Watchpoints, Next:Editing Watchpoint Properties, Up:Watchpoints

Setting Watchpoints

If the variable name is visible, click with mouse button 1 on the variable name. The variable name is copied to the argument field. Otherwise, enter the variable name in the argument field. Click on the Watch button to set a watchpoint there.

Using GDB and JDB 1.2, you can set different types of watchpoints. Click and hold mouse button 1 on the Watch button to get a menu.

Node:Editing Watchpoint Properties, Next:Editing all Watchpoints, Previous:Setting Watchpoints, Up:Watchpoints

Editing Watchpoint Properties

To change the properties of a watchpoint, enter the name of the watched variable in the argument field. Click and hold mouse button 1 on the Watch button and select Watchpoint Properties.

The Watchpoint Properties panel has the same functionality as the Breakpoint Properties panel (see Editing Breakpoint Properties). As an additional feature, you can click on Print to see the current value of a watched variable.

Node:Editing all Watchpoints, Next:Deleting Watchpoints, Previous:Editing Watchpoint Properties, Up:Watchpoints

Editing all Watchpoints

To view and edit all watchpoints at once, select Data => Watchpoints. This will popup the Illegal HTML tag removed : Watchpoint Editor which displays the state of all watchpoints.

The Watchpoint Editor has the same functionality as the Breakpoint Editor (see Editing all Breakpoints). As an additional feature, you can click on Print to see the current value of a watched variable.

Node:Deleting Watchpoints, Previous:Editing all Watchpoints, Up:Watchpoints

Deleting Watchpoints

To delete a watchpoint, enter the name of the watched variable in the argument field and click the Unwatch button.

Node:Interrupting, Next:Stopping X Programs, Previous:Watchpoints, Up:Stopping

results matching ""

    No results matching ""