Setting a Breakpoint on a Variable

You can stop execution of your program whenever a variable in a specific class and field is accessed (for example, the method was called with the variable as an argument) or modified.

To set a breakpoint on a variable:

  1. Select the variable in the Source Editor.
  2. From the main menu, choose Debug and choose Add Breakpoint (Ctrl-Shift-F8).
  3. In the Add Breakpoint dialog box, select Variable from the Breakpoint Type combo box.
  4. Specify the breakpoint settings:
  5. Specify the actions to take when the breakpoint is hit:
  6. Click OK.

    The breakpoint is added to the Breakpoints view of the Debugger window.

See also
Setting a Breakpoint on a Line
Setting a Breakpoint on a Method Name
Setting a Breakpoint on an Exception
Setting a Breakpoint on a Class
Setting a Breakpoint on a Thread

Legal Notices