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.
3.3 KiB
20 — Debug Adapter Protocol service
The C++ stdio adapter serves recorded GCC constant evaluations. Standard DAP clients can launch a selected journal, inspect stack frames, scopes, return values and captured source, and continue through integral returns. Seven registered cases and a real-journal transcript exercise lifecycle, error and source boundaries. A headless Neovim 0.12.6 client reached 17 and 34. Live compiler control, additional breakpoint kinds and source stepping remain open. Requirements: R-017,R-018,R-019,R-020 Dependencies: 18,19; shared session service with21 and client integrations22/23.
Ownership and boundaries
Proposed Sol protocol adapter: NEW include/vls/debug/dap/, src/debug/dap/, tests/debug/dap/. Astra reviews control-state boundary. 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
C++ DAP adapter maps one identified client to the shared debug session service over private bounded IPC. Support initialize/launch/configuration/breakpoints, threads/stack/scopes/variables, continue/next/stepIn/stepOut/pause, disconnect and source retrieval where implemented. Advertise only implemented DAP capabilities and mode-specific operations.
Implementation sequence
- Implement DAP framing/envelopes separately from LSP's JSON-RPC semantics; reuse safe byte/JSON primitives but preserve DAP seq/request_seq/event contracts.
- Map control to the session state machine, serialize conflicting requests and deliver required stopped/continued/terminated/progress events. Attach every response/handle to correct session/stop generation.
- Expose logical evaluator frames and captured source references; map replay actions to cursor movement, never to unimplemented live reverse execution.
- Negotiate the versioned read-only custom inspection requests for21. Bind adapter/service channels to inherited descriptors or explicitly verified private local connections; no public TCP endpoint.
Failure behavior and constraints
Invalid state, stale handle, unsupported operation or expired session returns a DAP error rather than deadlock. Cancellation must still terminate the original request appropriately. Disconnect cleanup remains effective after client crash and partial protocol input.
Acceptance scenarios
- Replay protocol transcripts covering full live and recorded sessions, malformed frames, out-of-order requests and capability negotiation.
- Verify request correlation, event ordering, stale references and cancellation/progress terminal behavior.
- Drive actual Neovim/VS Code adapters; test disconnect during running/stopped/replaying states with process cleanup evidence.
Verification and integration
Proposed NEW CTest label: dap. Once implemented, register a nonzero suite and run:
dev cpp-gcc -c ctest --test-dir build/bootstrap -L dap --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. Version adapters and service protocol together; refuse incompatible clients explicitly. A DAP failure must not corrupt LSP sessions or trace storage; restart only the affected debug connection.