JetBrains Rider 2018.2 Help

Stepping through Code

While examining a suspended program, you get control over the program execution — by manually stepping through the program, you can advance the execution point to the code you are interested in. There are multiple ways of how you can do this described in this section.

The current execution point is the next line to be executed. During debugging, this line is marked with a yellow execution pointer execution pointer placed in the left-hand gutter of the editor. To quickly find the current execution point, press Alt+NumPad * or click Show Execution Point icons debugger showCurrentFrame svg in the Debug window.

Step into

When you need to debug a function called from the current line, you can step down into the call chain with the Step Into icons actions traceInto svg command (F11) that is available in the Run menu and in the Debug window.

The debugger will set the execution pointer at the first statement of the first function called from the current line.

By default, JetBrains Rider enables external-source debugging, which means that when you step into the library code it will be automatically decompiled and the debugger will move the execution point there.
If you want the debugger to ignore the library code, you can disable external-source debugging — Clear Enable external source debug on the Build, Execution, Deployment | Debugger page of JetBrains Rider settings (Ctrl+Alt+S).

Smart step into

If the current line contains several nested calls, JetBrains Rider lets you choose a call to step into. Consider the following code line:

Console.WriteLine(Foo(Bar("input") + Baz("input")));
The line contains several calls and if you use Step Into, the debugger will first step into the implementation of Bar(), then into the implementation of Baz() and so on.

If you want to choose which of the calls should be stepped into, for example, Bar(), you can use Smart Step Into icons debugger smartStepInto svg (Shift+F7):

JetBrains Rider: Smart step into - stepping into selected call

When you choose the function to step into, the debugger will set the execution pointer at the first statement of the selected function.
The selector also shows you which of the calls were already executed and allows you to execute these calls again.

Step out

If you no longer want to debug a function (e.g., the one you've just stepped into), use the Step Out icons actions stepOut svg command (Shift+F11) that is available in the Run menu and in the Debug window.

The debugger will execute the remaining lines of the function by itself and set the execution pointer at the statement following the function call.

Step over

If you are not interested in how a particular function works, you can skip it over (the function will still be executed) — use the Step Over icons actions traceOver svg command (F10) that is available in the Run menu and in the Debug window.

Force step over

If a function you want to step over contains breakpoints, the debugger will stop on those breakpoints if the corresponding statements are executed. You can force the debugger to skip breakpoints inside the call chain with the Force Step Over icons debugger actions force step over svg command (Shift+Alt+F8) that is available in the Run menu and in the Debug window.

Run to Statement

If you know exactly what code you want to inspect, you can tell the debugger to run to a specific statement. The easiest way to do so is to run the program to the current cursor location with the Run to Statement icons actions runToCursor svg command (Ctrl+F10) that is available in the Run menu and in the Debug window.

Force Run to Statement

If there are breakpoints between the current execution point and the cursor location, you can force the debugger to skip these breakpoints with the Force Run to Statement icons debugger actions force run to cursor svg command (Ctrl+Alt+F9) that is available in the Run menu and in the Debug window.

Breaking into code

While the program runs under the debugger control, you can break its execution at any time. The debugger will stop at the next available line of code.

To break the execution, use the Pause Program command (Ctrl+Pause) that is available in the Run menu.

Changing the execution flow

Sometimes, you may want to skip a part of code without actually executing it (e.g., to avoid a known bug) or to return to a statement that has been already executed. This can be done by forcibly setting the next statement at the current line — use the Jump to statement icon jump to statement command (Ctrl+Shift+Alt+F9) that is also available in the Run menu.

Important notes:

  • Statements between the old and the new execution points are not executed.

  • It is impossible to set the next statement in another function.

  • When moving backwards, the already executed statements are not undone.

Dragging the execution pointer

To change the execution position, you can move the execution pointer execution pointer with your mouse, dragging-and-dropping it to another line:

JetBrains Rider: Dragging the execution pointer
Last modified: 4 October 2018