Skip to main content

Crate dscode_dap

Crate dscode_dap 

Source
Expand description

§dscode-dap

Debug Adapter Protocol client, manager, and pool for DSCode.

This crate provides a complete DAP client implementation with:

  • DebugAdapter — State-machine-based DAP client that manages a debug adapter process
  • DebugManager — Registry for debug sessions and breakpoints
  • DebugAdapterPool — Connection pool with one adapter per debug session

§State Machine

The DebugAdapter follows a strict lifecycle:

Stopped → Starting → Initializing → Configured → Running
   ▲          │           │              │           │
   │          ▼           ▼              ▼           ▼
   │       Crashed ◄── Crashed ◄─── Crashed ◄── Crashed
   │                                                   │
   │                                       ShuttingDown│
   │                                           │      │
   └───────────────────────────────────────────┘      │
                                               ▲       │
                                               └───────┘

§Example

use dscode_dap::{DebugAdapterPool, DebugManager, DebugSession, DebugState};

let manager = DebugManager::new();
let session_id = manager.create_session("main".to_string(), "cppdbg".to_string()).unwrap();

let pool = DebugAdapterPool::new();
pool.register_adapter("cppdbg".to_string(), "/usr/bin/gdb".to_string(), vec![]).await;

let session = manager.get_session(&session_id).unwrap();
let adapter = pool.create_session(session).await.unwrap();

Structs§

Breakpoint
DebugAdapter
A state-machine-based DAP client that manages a debug adapter process.
DebugAdapterPool
Pool for managing multiple debug adapters
DebugManager
DebugPoolStats
DebugSession
LaunchRequestArguments
Scope
Source
SourceBreakpoint
StackFrame
Thread
Variable

Enums§

DapError
Errors that can occur in Debug Adapter Protocol operations.
DebugAdapterState
State machine for the DAP debug adapter lifecycle.
DebugState