Debug Adapter Protocol (DAP)

The Debug Adapter Protocol (DAP) defines the abstract protocol used between a development tool, such as an editor or IDE, and a debugger. The official site states that the protocol exists so that “implementing the support for a debugger for a development tool can be done once” through an intermediary component called a debug adapter, which can then be reused across many editors. It is the debugging counterpart to the Language Server Protocol, applying the same decoupling logic to a different problem.

The motivation mirrors that of LSP. Without a common protocol, each editor would have to build a bespoke integration for every debugger, and every debugger backend would need editor-specific glue, an MxN explosion of integration work. DAP places a standardized debug adapter in the middle: the editor speaks DAP to the adapter, and the adapter translates to whatever the underlying debugger understands, whether that is GDB, LLDB, a language runtime, or a remote target. This turns the integration burden into M plus N.

Like LSP, DAP is a JSON-based request, response, and event protocol. The specification defines messages for the lifecycle of a debug session: an initialize handshake that negotiates capabilities, requests to set breakpoints, launch or attach to a debuggee, step through code, inspect stack frames, evaluate expressions, and read variables and scopes. The debugger pushes events back to the editor for state changes such as the program stopping at a breakpoint, a thread starting, or output being produced.

DAP grew out of Visual Studio Code’s debugging architecture, where Microsoft needed a uniform way to present debugging UI regardless of which language or runtime was being debugged. By publishing the protocol openly, Microsoft enabled other editors and IDEs to adopt the same debug adapters, and enabled debugger authors to write a single adapter that works in any DAP-capable client.

Together, LSP and DAP form the two pillars of editor-agnostic language tooling. Where LSP handles static intelligence such as completion and navigation, DAP handles the dynamic, runtime side of development. Their shared design philosophy, standardizing the boundary between tool and capability over a simple JSON message protocol, has made it practical for a single language ecosystem to deliver a full development experience across the entire editor landscape.