Skip to content

Debug a program

Ferris IDEA debugs through the Debug Adapter Protocol: one adapter per language, which you install once. The debugger, breakpoints with conditions, hit counts and log messages, watches and the Breakpoints dialog are Works.

Stop at a breakpoint, step and evaluate
Ferris IDEA editor with tides.py open: the function average sums readings into total and returns total divided by the number of readings; below it a main block calls average on four readings; the caret is on line 3
  1. Ferris IDEA editor with tides.py open: the function average sums readings into total and returns total divided by the number of readings; below it a main block calls average on four readings; the caret is on line 3
  2. The same editor with a red breakpoint dot next to line 3, total = sum(readings), and the line tinted red
  3. The program is paused at line 3, highlighted in blue with the inline value of readings after it; the Debug tool window below shows the tabs Threads & Variables and Console, the frames average:3 and <module>:9, the variable readings with four values, and Paused (breakpoint)
  4. After Step Over the highlight is on line 4, return total / len(readings), with readings and total: 474.4 shown inline; the Variables pane now lists total = 474.4 float and the state says Paused (step)
  5. The caret is inside the word readings on line 4 while the program is still paused
  6. A popup below line 4 shows readings = [112.0, 98.5, 143.2, 120.7]
  7. The Debug tool window says Process finished with exit code 0 and Frames appear when the program is paused; the breakpoint stays on line 3

Real frames of the application · ferris-idea drive, then ferris-idea drive screenshot after each step (docs/site/scripts/record-tour.py) · main build of v1.6.0, 2026-12-04 · throwaway Python demo project with a virtual environment; theme Ferris IDEA Dark

Install the debug adapter for your language; each language page names the command.

Language Adapter Install
Rust, C, C++, Swift lldb-dap Rust
Python debugpy Python
JavaScript, TypeScript js-debug JavaScript and TypeScript
Go Delve Go
Java java-debug, inside jdtls Java and Kotlin
Kotlin kotlin-debug-adapter Java and Kotlin

On macOS, native programs and Go need Developer Mode: sudo DevToolsSecurity -enable.

  1. Set a breakpoint: click a line number, or put the caret on the line and press ⌘F8 (Run › Toggle Line Breakpoint).
  2. Start the program under the debugger in one of these ways:
    • Run › Debug Current File (⌃⇧D);
    • Run › Debug (⌃D) for the selected configuration, or Run › Debug… (⌃⌥D) to pick one;
    • the Debug button in Edit Configurations… or the run widget.
  3. Ferris IDEA picks the adapter from the command: python → debugpy, node and package scripts → js-debug, go run and go test → Delve, cargo run → a cargo build, then lldb-dap, java and Maven’s exec:java → java-debug.
  4. The program stops at the breakpoint. The line is highlighted, and the Debug tool window (⌘5) opens with Threads & Variables and Console.

The Debug toolbar and the Run menu have the same commands:

Command Key What it does
Step Over F8 runs the current line, stops at the next
Step Into F7 goes into the function called on this line
Smart Step Into ⇧F7 asks which of the calls on the line to enter
Step Out ⇧F8 runs to the end of the current function
Run to Cursor ⌥F9 runs to the caret line
Resume Program ⌥⌘R or F9 runs to the next breakpoint
Pause Program none stops the program where it is
Stop ⌘F2 ends the session

The ⋮ menu of the toolbar has more: Force Step Over and Into, Force Run to Cursor, Show Execution Point (⌥F10), Reset Frame, Step Out of Code Block, Resume and Pause All Threads, Get Thread Dump and Reload Changed Classes.

  • Frames: the call stack of the selected thread; library frames are folded into “n hidden frames”. Select a frame to see its variables. Java shows the thread with its state and group.
  • Variables: expand objects and collections. The context menu has Set Value… (F2), Copy Value, Copy Name, Add to Watches, Inspect…, View as, and a renderer per type.
  • Inline values: while paused, the editor shows the values of the variables a line uses after that line, in grey.
  1. While paused, press ⌥F8 (Run › Evaluate Expression…). The focus goes to the field at the top of the Variables pane, “Evaluate (↩) · Watch (⇧⌘↩)”.
  2. Type an expression in the program’s language; completion helps. Press ↩. The result shows in the Variables pane, where you expand it like any variable.
  3. ⇧↩ switches to several lines (code fragment mode); evaluate them with ⌘↩. ↑ and ↓ step through earlier expressions.

For a quick look, put the caret on an expression in the editor and press ⌥⌘F8 (Quick Evaluate Expression): the value opens in a popup. The debug console’s >>> line evaluates in the adapter’s own console as well.

Press ⇧⌘↩ in the evaluate field, or choose Add to Watches in the editor’s or the Variables pane’s context menu. Watches are evaluated at every stop and kept for the next session.

Right-click a breakpoint, or press ⇧⌘F8 on its line, for a small popup with Enabled, Suspend (all threads or this thread) and Condition. More opens the Breakpoints dialog (Run › View Breakpoints…), with every breakpoint grouped by kind and these properties:

Property Effect
Condition stops only when the expression is true; ⇧↩ gives five lines
Pass count stops on every n-th hit
Log message writes a message to the console; {expression} parts are evaluated
Log “breakpoint hit” message, Log stack trace write to the console at each hit
Remove once hit a temporary breakpoint; also ⌥⇧⌘F8 or ⌥-click on a free line
Disable until hitting waits for another breakpoint first
Instance, class and caller filters stop only for matching objects or callers

When an adapter cannot evaluate conditions, pass counts or log messages itself, Ferris IDEA does it at each stop. That is slower, and the debug console says so. A condition that fails to evaluate stops the program and the console names the error.

⌥-click on a breakpoint turns it off and on. Mute Breakpoints in the Debug toolbar skips all of them for the session.

In the Breakpoints dialog:

  • Exception Breakpoints per language (Java, Python, JavaScript, native, Go): stop on caught, uncaught or both, optionally only for named exception types (classes for Java).
  • + Method Breakpoint (⌘N): stop on entry or exit of a function or method. ⌘F8 on a Java method header sets one directly.
  • + Field Watchpoint (⇧⌘N), Java only: stop when a field is read, written or both. Add Field Watchpoint is also in the Variables menu.

Breakpoints are saved in the project’s .ferris-idea folder and come back when you reopen it.

  • “Cannot debug Language: … is not installed (…)”: the message names the install command or the folder the adapter goes into.
  • A breakpoint is not hit and stays unverified: the adapter could not place it, for example on a line without code, or in a program built from another path or without debug information.
  • The program runs past the breakpoint: the program that ran is not the one built from these sources, or breakpoints are muted.
Keyboard of
ActionShortcut
Debug⌘5Alt5
Run › Debug⌃DShiftF9
Run › Debug Current File⌃⇧Dno shortcut
Run › Evaluate Expression⌥F8AltF8
Run › Quick Evaluate Expression⌥⌘F8CtrlAltF8
Run › Resume Program⌥⌘R or F9F9
Run › Run to Cursor⌥F9 or mouse:ForcetouchAltF9
Run › Step IntoF7F7
Run › Step Out⇧F8ShiftF8
Run › Step OverF8F8
Run › Toggle Line Breakpoint⌘F8CtrlF8
Run › View Breakpoints⇧⌘F8CtrlShiftF8
Set valueXDebugger.SetValueF2F2
Show execution pointShowExecutionPoint⌥F10AltF10
Smart step intoSmartStepInto⇧F7ShiftF7
Toggle temporary line breakpointToggleTemporaryLineBreakpoint⌥⇧⌘F8CtrlShiftAltF8

An agent debugs through the same sessions. Reading adapters and sessions needs no right; starting, stepping and evaluating need debug, and starting also a trusted project; setting breakpoints needs write; you grant rights per workspace.

  • debug_adaptersreadsDebug adapters (Debug Adapter Protocol) Ferris IDEA knows: name, languages, start command when installed, and whether this machine lets a debugger run without a password prompt.
  • debug_attachchangesdry run by defaultdebugAttach a debugger to a running program: native (lldb-dap), python (debugpy), node (js-debug), java (JDWP) or go (Delve), by pid or debug port.
  • debug_breakpointschangesdebugThe line breakpoints of a debug session, and changing them while it goes on — stopped or running: with path and breakpoints the file's line breakpoints are replaced by that list (line, condition, hit_condition, log_message, enabled; an empty list removes them all), as the Breakpoints dialog does for a running session; the saved breakpoints of the workspace stay as they are.
  • debug_completionschangesdebugCompletions the debug adapter offers for an expression in a stopped session (as in the Evaluate field): text with the caret at its end or at 1-based column, in frame (default the top frame).
  • debug_disassemblechangesdebugDisassembly of a stopped native debug session (DAP disassemble with symbols): from address (hexadecimal with 0x; default the stopped thread's current instruction), starting before instructions ahead of it, count instructions (default 32, at most 256).
  • debug_evaluatechangesdebugEvaluate an expression in a stopped debug session (default: top frame of the thread that stopped last).
  • debug_field_watchchangesdebugWatch a field of an object in a stopped debug session: the field name of the structured value reference becomes a field watchpoint (data breakpoint) that stops on writes (or read, readWrite); returns the adapter's id of the field, which set_special_breakpoints fields also takes.
  • debug_hot_swapchangesdebugHot swap (Reload Changed Classes, SPEC-0091 v12): builds the changed workspace sources files for a Java debug session (java-debug in jdtls) and reloads the changed classes into the running program; returns their names.
  • debug_inspectchangesdebugInspect a value of a stopped debug session: the expression's value with its type, reference and first level of children, optionally in a view (hex, binary, char, decimal of an integer; text, elements, entries evaluated as Java String.valueOf/toArray()/entrySet().toArray() or Python str/list), or with referring the objects that refer to it (Python's gc; refused by java-debug, which offers no such request).
  • debug_memorychangesdebugBytes of memory of a stopped native debug session (DAP readMemory): address hexadecimal with 0x, count bytes (default 256, at most 4096; capped when cut).
  • debug_pausechangesdebugPause a running debug session's program (after debug_resume returned while it still ran) and return where it stopped, like debug_resume.
  • debug_processesreadsLocal processes of this user that a debugger can attach to: id, name, command line, runtime (native, python, node, java) and the debug port its command line opens (JDWP agent, node --inspect, debugpy --listen); processes with a debug port first.
  • debug_registerschangesdebugThe registers of the top frame of a stopped native debug session (lldb-dap), by group as the adapter gives them (General Purpose Registers, …), at most 512 per group with left_out beyond.
  • debug_rendererschangesdry run by defaultwriteRenderers of the Debug window: how values of a type are shown, an expression in which this (Java) or self (Python) is the value, kept in .ferris-idea/debug-renderers.json.
  • debug_reset_framechangesdebugReset Frame: run a frame of a stopped debug session again from its start (default the top frame) and return where it stopped, like debug_resume.
  • debug_resumechangesdebugResume a debug session (continue, next, step_in, step_out on the thread that stopped last; force_next steps over without stopping at breakpoints; step_in_target steps into the call target from debug_step_targets) and wait for the next stop or the end; wait resumes nothing and only waits again, for a program that still ran when the last wait ended.
  • debug_run_to_linechangesdebugRun a stopped debug session's program to a line (Run to Cursor): a breakpoint is added there until the next stop, wherever that is.
  • debug_sessionsreadsThe debug sessions this server holds, oldest first: per session session (the number the other debug tools take), stopped (true with the thread that stopped last; false while the program runs or after it ended — debug_resume with wait tells which), adapter (the debug adapter's id, e.g.
  • debug_set_variablechangesdebugChange a local variable (or, with reference, a field of a structured variable) in a stopped debug session and return the value as the debugger now shows it.
  • debug_startchangesdry run by defaultdebugtrusted-projectStart a debug session: native programs with lldb-dap, Go with Delve (go_test for tests), Python with debugpy, Node.js/TypeScript scripts or an npm_script with js-debug, or a Kotlin main_class.
  • debug_step_targetschangesdebugList the calls on the stopped line that Smart Step Into can enter (id, label), for debug_resume with step_in_target.
  • debug_stopchangesdebugEnd a debug session: the program is terminated and the adapter stops.
  • debug_threadschangesdebugThe threads of a stopped debug session: id, name, state (Java: RUNNING, WAIT, MONITOR, NEW, ZOMBIE, read from the JVM; empty where the adapter cannot tell, e.g.
  • debug_variableschangesdebugChildren of a structured variable in a stopped debug session (struct fields, array elements) by its non-zero reference.
  • saved_breakpointsreadsBreakpoints saved for this workspace, as the editor's gutter and the Breakpoints dialog show them: file, 1-based line, condition, pass count (hit_condition), log message, enabled.
  • set_breakpointchangesdry run by defaultwriteAdd, change or remove a saved breakpoint of this workspace: 1-based line with an optional condition, pass count (hit_condition), log message (logs instead of stopping) and enabled=false to keep it switched off; remove=true removes it; remove_all=true removes every breakpoint of path (.: of the whole workspace) and reports how many.
  • set_special_breakpointschangesdry run by defaultwriteException and method breakpoints of this workspace, as the Breakpoints dialog shows them: stop on caught and/or uncaught exceptions (optionally only exception_types), and on entry or exit of functions (a given list replaces the saved one).