Step through code

Last modified: 17 November 2021

In a suspended program, you get control over the program execution. By stepping through the program, you can advance the execution point to the code you are interested in and examine the program state at this point.

When the code is running in the debug mode, there are two ways to suspend it:

  • Set breakpoints in the code that you want to examine and wait until one of them is hit.

  • Break program execution with Ctrl+Alt+Break. The debugger will finish the statement that is executing at the moment you pause, and then stop at the statement that should be executed next.

In the suspended state, the current execution point — the next statement to be executed — is marked with a yellow execution pointer Execution pointer in the left-hand gutter of the editor. To quickly find the current execution point, press Alt+F10 or click Show Execution Point Show Execution Point in the Debug window.

All stepping commands are available in the Run menu, via shortcuts, and with buttons on the Debug window toolbar:

JetBrains Rider: Stepping buttons on the Debug window toolbar

Below is a brief summary of all stepping commands.

To finish the debugging session, press Ctrl+F2, select Run | Stop in the menu, or click Stop Stop in the Debug window.