DataGrip 2024.2 Help

Breakpoints

Breakpoints are special markers that suspend program execution at a specific point. This lets you examine the program state and behavior.

Once set, a breakpoint remains in your project until you remove it explicitly.

Set breakpoints

Set a new breakpoint

  • Click the gutter at the executable line of code where you want to set the breakpoint. Alternatively, place the caret at the line and press Ctrl+F8.

    Line breakpoint

Manage breakpoints

Remove breakpoints

  • Click the breakpoint in the gutter.

To avoid accidentally removing a breakpoint, you can choose to remove breakpoints by dragging them to the editor or clicking the middle mouse button. To do this, go to Settings | Build, Execution, Deployment | Debugger and select Drag to the editor or click with middle mouse button. Clicking a breakpoint will then enable or disable it.

Mute breakpoints

If you don't need to stop at your breakpoints for some time, you can mute them. This allows you to resume normal program operation without leaving the debugger session. After that, you can unmute breakpoints and continue debugging.

  • Click the Mute Breakpoints button Mute Breakpoints button in the toolbar of the Debug tool window.

Enable/disable breakpoints

When you remove a breakpoint, its internal configuration is lost. To temporarily turn an individual breakpoint off without losing its parameters, you can disable it:

  • For non-exception breakpoints: right-click it and set the Enabled option as required. You can also toggle them with the middle mouse button if removing breakpoints is not assigned to it.

  • For all breakpoints: click Run | View Breakpoints Ctrl+Shift+F8 and check/uncheck the breakpoint on the list.

Move/copy breakpoints

  • To move a breakpoint, drag it to another line.

  • To copy a breakpoint, hold Ctrl and drag a breakpoint to another line. This creates a breakpoint with the same parameters at the destination.

View all set breakpoints

You can view the list of all breakpoints in the Bookmarks tool window. Breakpoints are automatically added to the dedicated list in the tool window once you place them in your code.

  • In the main menu, go to View | Tool Windows | Bookmarks and expand the Breakpoints list.

Group breakpoints

You can organize breakpoints into groups, for example, if you need to mark out breakpoints for a specific problem.

  • In the Breakpoints dialog Ctrl+Shift+F8, select a breakpoint you want to place in a group and select Move to group from the menu.

Productivity tips

Add breakpoint descriptions

If you have many breakpoints in your project, you can add descriptions to breakpoints for ease of search. To do this, right-click a breakpoint in the Breakpoints dialog Ctrl+Shift+F8 and select Edit description from the menu. Now when you start typing the breakpoint name, it gets the focus.

Last modified: 12 August 2024