KEMBAR78
Step through the program | RubyMine Documentation

RubyMine 2025.2 Help

Step through the program

Stepping is the process of controlling step-by-step execution of the program.

RubyMine provides you with a set of stepping actions. The choice of a particular stepping action depends on your strategy, such as whether you need to go directly to the next line or inspect the intermediate method calls as well.

The stepping buttons are located on the Debug tool window toolbar.

Stepping buttons in the Debug tool window

Step over

Steps over the current line of code and takes you to the next line even if the highlighted line has method calls in it. The implementation of the methods is skipped, and you move straight to the next line of the caller method.

  • Click the Step Over button Step Over button or press F8.

If there are breakpoints inside the skipped methods, the debugger will stop at them. To skip any breakpoints on the way, use Force step over.

Step into

Enters the method to show what happens inside it. Use this option when you are not sure the method is returning a correct result.

  • Click the Step Into button Step Into button or press F7.

If there are several method calls on the line, RubyMine asks you which method to enter. This feature is called Smart step into.

Smart step into

Smart step into is helpful when there are several method calls on a line, and you want to be specific about which method to enter. This feature allows you to select the method call you are interested in.

  1. Select Smart Step Into from the menu or press Shift+F7.

  2. Click the method. Alternatively, select the method using the arrow keys or the tab key, and then confirm the selection by pressing either Enter or F7.

    Step into

By default, Smart Step Into is used automatically every time you invoke Step Into on a line with multiple method calls.

To suppress automatic Smart Step Into, open the Settings dialog (Ctrl+Alt+S) , go to Build, Execution, Deployment | Debugger | Stepping, and clear the Always do smart step into checkbox.

After that, the Smart Step Into icon appears on the toolbar of the Debug tool window. Click this icon or press Shift+F7 to invoke Smart Step Into manually.

Step out

Steps out of the current method and takes you to the caller method.

  • Click the Step Out button Step Out button or press Shift+F8.

Run to cursor

Continues the execution until the position of the caret is reached.

  1. Place the caret at the line where you want the program to pause.

  2. Select Run to Cursor from the menu or press Alt+F9.

Also, in the Classic UI, you can Run to Cursor by clicking the line number in the gutter.

Run to Cursor with a single click

You can configure whether you want Run to Cursor to work on clicking a line number in Settings | Build, Execution, Deployment | Debugger.

To skip any breakpoints on the way, use Force run to cursor.

Force step into

Steps in the method even if this method is skipped by the regular Step Into.

  • Press Alt+Shift+F7.

  • Click the More icon on the toolbar and select Force Step Into from the list.

    Invoke hidden action - Force Step Into
  • Click the Force Step Into icon on the toolbar.

    To add the Force Step Into icon to the debugger toolbar, right-click the toolbar, select Add to Debugger Toolbar from the context menu, and then select Force Step Into from the list.

    Customize Debugger Toolbar - add actions
  • Go to Run | Debugging Actions | Force Step Into.

  • Select Force Step Into from the menu or press Alt+Shift+F7.

static void count(int to) { for (int i = 0; i < to; i++) { // the program is suspended here System.out.println(i); } System.out.println("Complete!"); }
public void println(String x) { // Force Step Into enters the implementation of PrintStream.println() if (getClass() == PrintStream.class) { writeln(String.valueOf(x)); } else { synchronized (this) { print(x); newLine(); } } }

Force run to cursor

Continues the execution until the position of the caret is reached. All breakpoints on the way are ignored.

  1. Place the caret at the line where you want the program to pause.

  2. Select Force Run to Cursor from the menu or press Ctrl+Alt+F9.

Force step over

Steps over the current line of code and takes you to the next line even if the current line has method calls in it. If there are breakpoints in the called methods, they are ignored.

  • Select Force Step Over from the menu or press Alt+Shift+F8.

16 September 2025