This page describes how to use the Breakpoints View that is part of the Debug perspective.
Introduction
The Breakpoints View allows you to work with breakpoints that you have added to your JavaScript code. See Adding a breakpoint if you need help setting up a breakpoint. Breakpoints can help you determine the value or type of a variable or other useful information for an exact point in your JavaScript code.
Instructions
This section describes how to perform common tasks to work with breakpoints.
Setting the hit count for a breakpoint
Setting the hit count for a breakpoint will automatically suspend the execution of a thread after the breakpoint is "hit" the specified number of times. This is helpful if you have set a breakpoint inside of a loop structure.
To set the hit count for a breakpoint:
- Set up a breakpoint in your code (see Adding a breakpoint).
- In the Breakpoints View, right-click the breakpoint and select Hit Count... from the context menu to open a Set Breakpoint Hit Count prompt.
- In the Set Breakpoint Hit Count prompt, type the number of times that you want the code to execute through the breakpoint before suspending the code.
- Make sure that the Enable Hit Count box is checked.
- Click OK.
- Click the Resume button to resume the execution of your code.
Making a breakpoint conditional
You might want to make a breakpoint conditional if you only want your JavaScript code to break on that point if certain conditions are met.
To make a breakpoint conditional:
- In the Breakpoints View, right-click the breakpoint and select Properties from the context menu to open a Properties window.
- On the Properties window, check the Enable Condition box.
- In the large text box below Enable Condition, type the condition for the breakpoint.
- Click OK.
- Click the Resume button to resume the execution of your code.