Skip to content

Debugger

Ilia Maslakov edited this page Nov 16, 2026 · 2 revisions

Debugger

The debugger runs a program of the project under GDB, or under the debug adapter of its language, from the source windows of the editor: breakpoints in the gutter, steps through the source, and the call stack, the local variables and the watches in a panel beside it. While the program is stopped, the values of the variables are shown at the end of the lines that use them.

bluerig -D: a breakpoint in divide, F5 builds and runs the calculator in the Program tab, 1 0 / stops it with a = 1 and b = 0 in the panel, and F8 steps on, out of divide into apply

Starting

bluerig -D .          # or bluerig --debug DIR

opens the project of that directory to debug it: its latest file, the tree of the project at the right and the panel of the debugger under it. Then:

  1. F6 on a line puts a breakpoint (Ctrl-F8 or Ctrl-B anywhere).
  2. F5 builds the project and runs it (Shift-F9 anywhere). The first time, the form Debug configuration shows what it found: the program the build made, its arguments, its directory and environment, GDB or a debug adapter. Enter takes it.
  3. The program runs in a terminal of its own, the tab Program at the bottom, which gets the keys while the program runs; when it stops, the focus goes back to the source.

A program without debug information, or built with optimization, is told of, with the command that builds it fit for debugging. Without -D, the same keys are in the Debug menu, and Debug > Debug keys in files turns the keys of debug mode on.

The keys

The keys are those of IntelliJ IDEA, PyCharm and CLion where the editor leaves them free; F9 and F10 stay the menu and Quit.

Key Does
F5 Continue (build and run, when nothing runs)
F7, F8, Shift-F8 Step into, over, out
F4, Alt-F9 Run to the cursor
F6, Ctrl-F8 Toggle a breakpoint
Alt-F6 A condition on the breakpoint: i == 7
Enter, Alt-F8 Evaluate the word or the selection; add it to the watches
Alt-F10 Back to the line the program stopped at
Shift-F6 Pause the running program
Shift-F5, Ctrl-F2 Stop it
Alt-F5 To the panel of the debugger and back
Shift-F7, Shift-F4 Step by one machine instruction

The panel

The state of the program and how long the last step took (ran 0.004 s: a slow line shows at once), the local variables, the registers when they are asked for, the watches, the call stack and the breakpoints. The console has what the program writes, when it has no terminal of its own, and what GDB says; a line typed there goes to GDB.

Other languages

Most debuggers speak the Debug Adapter Protocol, and bluerig speaks it too. A program is given its adapter by the name of its file:

File Adapter
.py python3 -m debugpy.adapter (a .venv of the project is used)
.sh, .bash bash-dap
.go dlv dap
.js, .mjs, .ts js-debug-adapter
a program gdb -i dap, or GDB itself

F6 on a line of a script, F5 and Enter in the form: the same as for C.

Configurations and layouts

A project may have several configurations: Debug > New configuration, Select configuration, Configure selected. They are kept with your settings, or in .bluerig/debug.ini of the project for everyone who works on it. When the debugger starts, the windows are put as the layout Debug has them, and put back when it stops (Window > Layout).

Clone this wiki locally