Table of Contents
Breakpoints
A breakpoint is an interrupter of the debugging process. Set the breakpoint next to the string that you want to explore in more detail, and the Debugger will stop the execution at this point. This gives you the ability to see the actual state of code variables, look at the call stack, and find the reason of an issue.
Types of breakpoints
In the Debug Mode, you are faced with different types of breakpoints
- Enabled breakpoint — the red dot in the editor's left margin. It stops the debugging before the execution of this string.
- Disabled breakpoint — the gray dot in the editor's left margin. It is skipped during the execution of the Debugger.
- Invalid breakpoint — the red empty circle in the editor's left margin. It is invalid in the current location. This may happen if the breakpoint, for instance, is set in another test method, or at this string, there is no information for the debugging.
All the breakpoints are available in the Breakpoints panel.
Setting breakpoints
You have the ability to set the breakpoints before debugging as well as when you are already running the Debugger. You can do this in three ways:
- click on the editor's left margin next to the line, where you want to stop the debugging,
- place the cursor at the necessary line and press the Cmd+\ hotkey,
- use the context menu: place the cursor at the necessary line and select the New Breakpoint or Toggle Breakpoint option.
Enabling / Disabling breakpoints
The ability to enable or disable the breakpoints helps you to flexibly manage them. You can disable a breakpoint that you don't need to hit in the current execution but you still wish to leave it visible to have the ability to back to it later. You can do this by:
- unchecking the box next to breakpoint in the Breakpoints panel,
- using the
Enable / Disable Breakpoint button in the Breakpoints panel,
- using the context menu of the breakpoint in the editor,
- using the Main Menu:
Run ⇒ Enable / Disable Breakpoint
,
- using the context menu of the breakpoint in the Breakpoints panel,
- pressing the Alt+Cmd+/ hotkey, when the cursor is placed on the line with the breakpoint.
In addition, you can disable all the breakpoints with a few clicks: go to the Main Menu ⇒ Run ⇒ Enable or Disable All Breakpoints
.
You can do the same from the context menu of the breakpoint in the editor: click on the breakpoint and select the Enable or Disable All Breakpoints.
In addition, you can disable all the breakpoints from the context menu of the breakpoint in the Breakpoints panel or by using the Enable or Disable All Breakpoints button here.
To enable a breakpoint or all the breakpoints, just do the same action one more time.
Deleting breakpoints
When you don't need the breakpoint and don't want to interrupt the debugging process at this step, you can easily delete this breakpoint by one of the following ways:
- click on the breakpoint in the editor's left margin,
- mark the unnecessary breakpoint and click on the
Delete selection button in the Breakpoints panel,
- select Remove breakpoint from its context menu in the editor,
- select the Delete option from the context menu of the breakpoint in the panel.
You can also delete all the breakpoints:
- from the Main Menu:
Run ⇒ Clear All Breakpoints
,
- or select the Clear All Breakpoints option from the context menu of the breakpoint in the editor,
- or select the Clear All Breakpoints option from the context menu of the breakpoint or click on the
Clear All button in the Breakpoints panel.
In this section: |
This also may be useful: |