Debugger
Vix™ has an integrated debugger built on the Debug Adapter Protocol (DAP), the
same standard used by VS Code. You bring a debug adapter (e.g. debugpy,
codelldb); Vix drives it. Every debugger command is on the Run menu and
in the command palette.
For a guided first session with debugpy, see
Tutorial 10: Debugging with DAP.
This page is the reference.
Configure an adapter
Add adapters to your config.toml, matched to files by extension:
[[debug_adapters]]
adapter_id = "debugpy"
extensions = ["py"]
command = ["python", "-m", "debugpy.adapter"]
[[debug_adapters]]
adapter_id = "codelldb"
extensions = ["rs", "c", "cpp"]
command = ["codelldb"]
[debug_adapters.launch]
program = "{program}"
The [debug_adapters.launch] table is merged into the adapter’s launch request;
{program} expands to the file you’re debugging. An optional
[debug_adapters.attach] table is what Run → Attach sends instead, as the
attach request (e.g. processId = "4242"; values that read as JSON numbers,
booleans, objects or arrays are sent as such).
Start and stop
- Run → Start (
run.start) starts the adapter configured for the active file’s extension and launches it. Run → Attach (run.attach) sends theattachtable instead. - The status line says Debugger started and the Debug panel opens in the right dock. If the adapter cannot be started it says Failed to start debug adapter.
- With no file open it says Open a file to debug; with no adapter for the file’s extension, No debug adapter configured for this file type.
- Run → Stop (
run.stop) ends the session (Debugger stopped). The session also ends when the program exits.
Only one debug session runs at a time. Program output streams to the bottom dock.
Breakpoints
Vix has four kinds. Line, function and instruction breakpoints can be set before a session starts; every new session sends them during its handshake, and changes during a session are sent at once.
| Kind | Set with | Gutter | Kept after Vix exits |
|---|---|---|---|
| Line | Run → Toggle Breakpoint, Run → Edit Breakpoint… | ● | Yes, per workspace |
| Function | Run → Function Breakpoint… | none | Yes, per workspace |
| Instruction | Run → Instruction Breakpoint… | none | No (kept until Vix exits) |
| Data | Run → Data Breakpoint on Variable, or b in the Debug panel | none | No (this session only) |
Exception breakpoints are a fifth switch, chosen per adapter (below).
Line breakpoints
Run → Toggle Breakpoint (run.toggle_breakpoint) adds or removes a
breakpoint on the cursor line, drawn as a red ● in the gutter. The Eclipse
keymap binds it to Ctrl+Shift+B; the other keymaps leave it to the menu
and the palette.
Run → Edit Breakpoint… (run.edit_breakpoint) asks three questions in
a row about the cursor line’s breakpoint, creating it if there is none:
- Breakpoint condition, line N (empty: none): an expression; the program stops only when it is true.
- Hit count condition, line N (e.g. 3 or >= 5; empty: none): how the adapter counts hits.
- Log message, line N (logs instead of stopping; empty: none): turns the
breakpoint into a logpoint. How
{expr}in the message is filled in is up to the adapter.
Each prompt starts with the current value. An empty answer clears that field,
and Esc at any prompt abandons the whole edit. When you answer the last
prompt, the status line says Breakpoint on line N updated. Toggling the
breakpoint off removes it with all three fields.
Line breakpoints, with their condition, hit count and log message, are saved for the workspace when Vix exits and come back at the next start, even when you open Vix on a single file.
Function breakpoints
Run → Function Breakpoint… (run.function_breakpoint) asks for a
Function name to toggle a breakpoint on (empty: cancel). A new name adds a
breakpoint (Function breakpoint set on NAME), a name that already has one
removes it, and an empty answer does nothing. If the running adapter does not
support function breakpoints the status line says This debug adapter does
not support function breakpoints.
Instruction breakpoints
Run → Instruction Breakpoint… (run.instruction_breakpoint) asks for a
Memory reference of the instruction to toggle a breakpoint on, e.g. 0x4005d0
(empty: cancel), spelled the way your adapter spells addresses. The same
reference again removes it. With no session the breakpoint is only recorded,
and the next session sends it. If the running adapter cannot set them, the
prompt does not open and the status line says This debug adapter does not
support instruction breakpoints. They are not saved when Vix exits, because
addresses change from one run of a program to the next.
Data breakpoints
A data breakpoint stops when the memory behind a variable is written. While
the program is stopped, highlight a variable in the Debug panel and press b
(or choose Run → Data Breakpoint on Variable, run.data_breakpoint).
Vix asks the adapter whether that variable can be watched:
- If it can, the breakpoint is set on writes (or on the first kind of access
the adapter offers, when it offers no write watch): Data breakpoint set on
NAME. Pressing
bon the same variable again removes it. - If it cannot, the status line gives the adapter’s reason.
- With no variable highlighted, the status line says Select a variable in the Debug panel first. An adapter without data breakpoint support gives This debug adapter does not support data breakpoints.
Data breakpoints last for one session only and have no row in the Debug panel; the status line reports each change.
Exception breakpoints
Run → Exception Breakpoints… (run.exception_filters) opens the
Exception Breakpoints checklist of the filters your adapter offers (for
example, raised or uncaught exceptions), one [x] or [ ] row each. Enter
toggles the highlighted filter and keeps the list open; Esc closes it.
Until you change anything, the filters the adapter marks as defaults are on.
Your choice is sent at once and kept for later sessions until Vix exits.
The adapter only lists its filters once a session has started. Before that, the status line says No exception filters: start a debug session whose adapter offers them.
Step through the program
When the program stops at a breakpoint (or after Pause), the editor jumps
to the stop, the line is marked ▶ in the gutter, and the status line says
Paused (REASON) with the adapter’s reason.
- Run → Continue runs to the next stop.
- Run → Step Over, Step Into and Step Out move one step.
- Run → Pause stops a running program.
Inline values
While stopped, the stopped line shows the values of the variables it mentions at its end, for example:
y = x + p.x x = 1 p = Point
Only whole names count (xx does not show x), at most eight variables are
shown, and a value longer than 40 characters is cut short with …. The
values come from the first scope the panel expands (usually the locals). They
disappear when the program continues or the session ends.
The Debug panel
Run → Toggle Debug Panel (run.panel) shows or hides the Debug panel
in the right dock; it also opens by itself on Start. With no session it
reads Not debugging. Debug → Start. During a session it has four sections:
- Threads: every thread;
▶marks the current one. - Call Stack: the selected thread’s frames.
- Variables: the selected frame’s scopes, each expandable. The first scope that is cheap to fetch opens by itself.
- Watch: your watch expressions and their values.
An expandable row shows ▸ (closed) or ▾ (open), and a value follows its
name after =.
Run → Focus Debug Panel (run.focus_panel) shows the panel and gives it
the keyboard:
| Key | Action |
|---|---|
↑ / ↓, PageUp / PageDown, Home / End | Move the highlight (section headings are skipped) |
Enter | On a thread: select it. On a frame: select it and jump the editor there. On a scope or variable: expand or collapse it |
→ / ← | Expand / collapse (← on a child moves to its parent) |
e | Change the highlighted variable’s value (New value for NAME), if the adapter supports it |
b | Toggle a data breakpoint on the highlighted variable |
Esc | Give the keyboard back to the editor |
Keys with Ctrl, Alt or Super, and the function keys, still go to your
keymap, so Run commands bound to keys keep working while the panel has
focus.
Children of a variable are fetched the first time you open it, to any depth. When the program stops again, the variables you had open are opened again, matched by name, so stepping through a loop keeps your view.
Watches and Evaluate
- Run → Add Watch… (
run.watch) asks for a Watch expression. It is evaluated in the selected frame every time the program stops and listed under Watch. - Run → Evaluate… (
run.repl) asks Evaluate (debug) and prints the result of a one-off expression to the bottom dock.
Remote workspaces
In a remote workspace the adapter runs on the remote machine, started in the workspace root, and breakpoints and stops use the remote paths. The debugger waits until you trust the remote workspace. An adapter that listens on a TCP port instead of standard input and output is not supported.
Limits
- One debug session at a time.
- Data and instruction breakpoints have no row in the Debug panel, and an instruction breakpoint takes a memory reference only (no condition).
- A remembered expansion is matched by names, so two sibling variables with the same name share it.
See the specification at crates/vix-dap/spec/index.md.
Vix™ and Vix IDE™ are trademarks.