Skip to content

Stepping

Once the program is stopped, these are the ways to move it.

The commands

Key Action What it does
F9 continue run until the next breakpoint, or until the program ends
F8 step over run the current line, stop on the next one in this frame
F7 step into enter the call on the current line
Shift+F8 step out run until the current function returns
Cmd+F2 / Ctrl+F2 stop terminate the session

Two more actions exist without a default binding: pause — interrupt a running program — and restart. Give them keys in [ui.keymaps] if you use them; see Configuration → UI.

These keys work everywhere in the window, including while the cursor is inside the Evaluate or Watches input field. That is why they are function keys: they never collide with what you are typing.

Step over versus step into

On a line that calls a function:

  • step over runs the whole call and stops on the next line. Use it when you trust the callee.
  • step into stops at the first line inside the callee. Use it when the problem might be in there.

If the line contains no call, both do the same thing.

Step out

Runs the rest of the current function and stops just after it returns, in the caller. It is the fastest way back when you stepped into something by mistake, or when you have seen enough of a function.

What happens on each stop

Every stop refreshes the whole picture:

  • Call Stack rebuilds, with the topmost frame selected;
  • Variables shows the scopes of the selected frame;
  • Watches re-evaluate, every one of them;
  • the source panel marks the current line.

Selecting a different frame in the Call Stack re-points Variables and Evaluate at that frame, without moving execution.

Stepping in a multi-threaded program

Stepping applies to the thread the debugger currently has selected. Other threads may be running or stopped depending on the adapter's policy. Which thread you are looking at is shown in Threads.

When stepping seems stuck

A step that never completes usually means the program is blocked — waiting on I/O, a lock, or a network call inside the line you stepped over. The Logs panel shows whether the adapter is still answering; see Logs and Diagnostics.