GoLand 2018.3 Help

Debugging with Mozilla rr

Mozilla rr is a tool that you can use to record, replay, and debug applications. The main idea of Mozilla rr is to help you catch non-trivial bugs.

Mozilla rr records the whole program execution. It means that you can debug the recorded trace only when the program ends its execution. For servers and other long-running applications, you must terminate the running application (for example, by sending the SIGTERM signal from the console). After the recording, you can replay the execution in the debugger as many times as you need. Read more about Mozilla rr on the official Mozilla rr site.

Debug code with Mozilla rr

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

  2. In GoLand, 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, see Do not suspend code execution and Breakpoints.

  3. Click the Run icon (The Run icon) in the gutter and select Record and Debug <configuration_name>. In the Debugger tool window, you can see a status of variables, processes, and threads on different stages of code execution.

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 Debugger tool window, click the Resume Program icon (The Resume Program icon ) to continue program execution, or click the Rewind icon below to run the debug session backwards until the previous breakpoint.

Navigate through the recorded trace
Last modified: 6 February 2019