The debugger adapter#
alpha debug speaks the Debug Adapter Protocol on stdio.
What works today#
- launch — runs an Alpha-built artifact, streams its output, and reports
its exit status as
exitedandterminatedevents. - evaluate — answers debug-console expressions from the loaded closure using the compiler's own checker and normalizer. The answer is labelled reference execution, because that is what it is. An expression that does not check is an error response, never a value.
- loadedSources — the modules of the closure.
- threads, stackTrace — a single frame, named from the compiler's source map: the module, declaration and line the entry point was compiled from.
- setBreakpoints — verified against the source map. A line that emitted code was attributed to verifies; any other line is refused with the lines this program was compiled from, so a line no code came from is never shown as a valid breakpoint. A file outside the closure, or a build without a source map, is refused with that reason.
What is declared unsupported, and why#
supportsFunctionBreakpoints, supportsConditionalBreakpoints,
supportsStepBack, supportsSetVariable and supportsDisassembleRequest are
advertised as false, so a client never offers a button that cannot work.
The source map attributes code offsets to source lines; it says nothing about where a value lives. Stepping, local values and disassembly therefore remain unsupported, and the adapter does not yet pause a running artifact: a verified breakpoint marks a line the program really contains, and execution runs to its exit status.
Use it#
The VS Code extension in editors/vscode registers the alpha debug type,
which launches program (default ${workspaceFolder}/alpha.elf) through
alpha debug. Any Debug Adapter Protocol client can start alpha debug on
stdio in the workspace directory.
Evidence#
debug/dap-check.py drives the adapter as a client does: 11 checks in the
run recorded in docs/generated/ALPHA-DAP-CHECK.json, including that the
unsupported capabilities are declared unsupported.