Files
Language-Server/docs/roadmap/18-live-debugging.md
T
faumaray da8003f6d4 Implement the VLS roadmap on the native VBS build
Native VBS and CMake builds of the server and every registered suite:
protocol and document sync, VBS/compdb providers, stock GCC diagnostics
(including in-process default profile preparation), the stock occurrence
observer and hover/definition, the bounded Scheduler, C++ module graph,
scan and artifact cache with real CMI production, the context-aware
symbol index with schema-2 snapshot migration, navigation and guarded
rename, reflection provenance with splice-origin extraction, index-backed
completion and signature help, live GCC worker control with a registered
DAP suite, and the Neovim and VS Code clients.

VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced
from the versioned patches and verified stepping reflection/template code
with projected values 17/34 and 41/82.
2026-12-05 14:06:50 +03:00

3.5 KiB

18 — Live metaprogram debugger state and control

Status: The local GCC hook prototype and an unmodified GCC 16.2/GDB probe both observed nested integral returns after an enum edit. The fixed worker also exercised step, resume, cancellation and cleanup. A LiveSession control core and a live DAP mode (step/continue/cancel, bounded frame inspection with generation-bound handles) are now implemented with registered tests. General reflection, constraint and template inspection, breakpoints and typed value inspection remain open. Requirements: R-016,R-017,R-019,R-021 Dependencies: 09,10,12, successful17; shared sessions with19-21.

Ownership and boundaries

Proposed Astra: NEW include/vls/debug/session/, src/debug/session/, tests/debug/session/. Root owns state-machine/control DTOs. Future assignments must verify the then-current baseline and exact disjoint paths; these proposed scopes do not authorize work in another repository.

Contracts and data flow

Launch binds a frozen translation-unit/context snapshot and selected real evaluation/source/instantiation. States preparing/running/stopped/completed/failed/cancelled/expired are explicit. DAP alone controls execution; custom queries are read-only. Inspection handles include session/snapshot/stop generation and expire on movement.

Implementation sequence

  1. Validate launch/context completeness, admit one live compiler session per server instance and establish memory/process enforcement before execution. Missing explicit template arguments are not guessed.
  2. Implement source/event breakpoints, pause/continue and step-in/over/out at documented supported boundaries, with logical frames/scopes/typed values mapped to source snapshots.
  3. On source edits mark session outdated; require restart to adopt changes. Serialize control actions and bind asynchronous inspections to the current stop generation.
  4. Enforce2GiB worker/3GiB aggregate debug memory,60s running CPU,120s running wall watchdog,30min paused idle and5s disconnect cleanup. Limits are configurable; count paused memory and reap descendants.

Failure behavior and constraints

Reject launch when enforcement or source/context prerequisites are absent. Timeout/resource excess/cancellation preserves only committed trace data with explicit status. An intentional stop is not a stuck-worker timeout. Read-only inspection excludes arbitrary state-changing evaluation/set-variable; live reverse execution is not claimed.

Acceptance scenarios

  1. Exercise breakpoints and all stepping modes through nested template/constexpr/reflection calls, plus pending breakpoint resolution and failed constraints.
  2. Continue while old variable queries are in flight and reject stale handles/replies; edit source and verify frozen-session behavior.
  3. Test paused-session saturation, RSS/CPU/wall limits, zero-CPU hangs, disconnect/leader-exit descendants and foreground LSP latency during debug.

Verification and integration

Proposed NEW CTest label: live-debug. Once implemented, register a nonzero suite and run:

dev cpp-gcc -c ctest --test-dir build/bootstrap -L live-debug --output-on-failure

This future command is not evidence that the label/tests exist now. Before dispatch, bind the fixtures above to actual targets and record prerequisites/side effects. Require fresh independent review of the implemented contract and affected integrations. Cancel/reap sessions before backend/control protocol changes. Do not silently resume a paused target or reuse stale handles. Preserve recoverable trace prefixes separately from live compiler state.