# Adding watchpoints

A watchpoint is a special breakpoint that stops the execution of an application whenever the value of a given expression changes, without specifying where this may happen. Unlike breakpoints which are line-specific watchpoints are associated with files. They take effect whenever a specified condition is true regardless of when or where it occurred.

To add a watchpoint:

1. Click Run > Add C/C++ Watchpoint.

1. If Add C/C++ Watchpoint is not listed on the Run menu, select Window > Customize Perspective.
2. In the Customize Perspective dialog box, expand Other in the Available Items list.
3. Select the C/C++ Debug check box. Click OK.

2. In the Add C/C++ Watchpoint dialog box, type an expression in the Expression to watch box. The expression may be anything that can be evaluated inside an `if` statement.
3. Do any of the following:

- To stop execution when the watch expression is read, select the Read check box.
- To stop execution when the watch expression is written to, select the Write check box.

4. In the C/C++ editor, open the file that you added the watchpoint to.
5. Click OK.
6. The watchpoint appears in the Breakpoints view list.

C/C++ Development perspective

Working with breakpoints and watchpoints

Run and Debug dialog box