dap-protocol-guide

Guide DAP implementation and debugging across Python, JavaScript, and Java adapters.

19|2|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/ai-debugger-inc/aidb --skill dap-protocol-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dap-protocol-guide
Source: https://github.com/ai-debugger-inc/aidb/tree/main/.claude/skills/dap-protocol-guide
Command: npx skills add https://github.com/ai-debugger-inc/aidb --skill dap-protocol-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Debugging complex applications often involves understanding low-level communication between debuggers and debug adapters. This Skill demystifies the Debug Adapter Protocol (DAP), providing a comprehensive guide to its structure, message flows, and best practices within AIDB. It helps developers avoid common pitfalls and implement robust debugging features efficiently.

Core Features & Use Cases

  • DAP Protocol Mastery: Gain deep understanding of DAP types, requests, responses, and events.
  • Initialization & Breakpoint Flows: Learn the critical sequences for session setup and breakpoint management.
  • Language-Specific Nuances: Understand how DAP behaves differently across Python, JavaScript, and Java adapters.
  • Use Case: When integrating a new language debugger into AIDB, use this skill to ensure correct DAP message construction and sequence adherence, preventing protocol-level errors and accelerating integration.

Quick Start

Explain the standard DAP initialization sequence and how to set a conditional breakpoint in Python.

Frequently Asked Questions about dap-protocol-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement the Debug Adapter Protocol initialization sequence?

DAP initialization establishes a session between debugger and adapter through a handshake that exchanges capabilities and configuration. Start with an initialize request, receive capabilities response, then send initialized notification before breakpoints or execution commands. This sequence ensures both sides agree on supported features before debugging begins.

What is the Debug Adapter Protocol and why do I need it?

DAP is a standardized messaging protocol that decouples debuggers from language-specific debug adapters, enabling one debugger UI to debug multiple languages. It defines request/response/event types for breakpoint management, stack inspection, and variable evaluation, eliminating the need to rebuild debugging tools for each language.

How do I set a conditional breakpoint using DAP?

Send a setBreakpoints request with breakpoint objects that include line number and a condition expression. The adapter evaluates the condition at runtime and halts execution only when the condition is true. Include source file path and receive confirmation of breakpoint locations in the response.

How does DAP handle debugging differences across Python, JavaScript, and Java?

Each language adapter implements DAP's core message schema but varies in initialization parameters, variable scoping rules, and stack frame representation. Python adapters handle coroutines differently than Java's thread model; JavaScript adapts for async/await. Adapters report their capabilities during initialization so debuggers adjust behavior accordingly.

What are common DAP protocol errors when integrating a new debugger?

Violations include skipping initialization, sending requests out of sequence, mismatched thread IDs in stack inspection, and ignoring adapter capability flags. Protocol-level errors occur when breakpoint requests reference unsupported condition syntax or when responses omit required fields. Always validate initialization completion before issuing breakpoint or execution commands.

Can I use DAP to inspect variable state during execution?

Yes. After hitting a breakpoint, use variables request with a frame reference to retrieve local, global, and watch variables. Send evaluate request to compute expressions in the current scope. DAP returns variable names, types, and values; complex objects return reference handles for nested inspection.