llms.txt: machine-readable documentation index. Markdown version of this page is also available.

IntelliJ IDEA 2026.3 Help

Debugging with Mozilla rr

Mozilla rr records program execution so you can replay it in the debugger and investigate the same sequence of events more than once.

To debug a recording, wait for the application to exit or click stop the recording in the Debug tool window. You can then inspect the recorded execution and move forward or backward between breakpoints.

Debug code with Mozilla rr

  1. Install Mozilla rr. For installation instructions, refer to the Building And Installing.

  2. In IntelliJ IDEA, set a breakpoint. To set a breakpoint, click the gutter near the code line where you want the debugger to stop code execution. For more information about breakpoints, refer to Debug code and Breakpoints.

  3. Click the Run icon (The Run icon) in the gutter and select Record and Debug <configuration_name>. After recording finishes, inspect variables and goroutines in the Debug tool window.

Navigate through the recorded trace

  1. Navigate to Run | Debug Saved Trace.

  2. In the Trace directory field, specify a path to the trace directory.

  3. Click OK.

  4. In the Debug tool window, click Resume Program to move forward to the next breakpoint, or Rewind to move backward to the previous breakpoint.

Collecting Mozilla rr traces

  1. In the application directory, build an executable with optimizations and inlining disabled:

    go build -gcflags="all=-N -l" -o myApp

    Keep the debug information in the executable. Do not use linker flags such as -w or -s that remove information needed by the debugger.

  2. Open the terminal and run the following Mozilla rr command: rr record <path_to_the_application_executable>

    As a result, the Mozilla rr trace files appear in the following folder: ~/.local/share/rr/<executable_name>

Remote debugging with Mozilla rr

  1. On the remote machine, collect the Mozilla rr trace.

  2. On the remote machine, start Delve with a loopback listener:

    dlv --headless --api-version=2 --listen=127.0.0.1:2345 replay /path/to/trace/dir

    Replace /path/to/trace/dir with the recorded trace directory.

  3. On your local machine, forward the debugger port through SSH:

    ssh -N -L 2345:127.0.0.1:2345 user@remote-host

    Replace user and remote-host with your SSH username and the remote computer's address. Keep the connection open while debugging. Delve connections are not authenticated; keep the debugger port private.

  4. On the local machine, create the Go Remote run/debug configuration. Set Host to 127.0.0.1 and Port to 2345. For more information about creating run/debug configurations, refer to Create a run/debug configuration.

  5. On the local machine, ensure that the Go Remote run/debug configuration is selected from the list of configurations.

  6. On the local machine, click Run | Debug <remote_configuration_name>. Alternatively, press Shift+F9.

23 September 2026