Qwen DAP MCP — C/C++ Debugger for Claude Code, Codex & Qwen
v0.19.4C/C++ crash, hang and dump debugging for Claude Code, Codex and Qwen via GDB, LLDB and MCP
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
debug_sessions Manage Debug Sessions
Use this tool to list, create, or close isolated DAP sessions before routing other debugger tools with sessionId. Omit sessionId on normal debug tools only when the backward-compatible default session is intended; do not use a global session selector for concurrent work.
| Parameter | Type | Description |
|---|---|---|
action | string | Management action: list current sessions, create a new isolated session, or close one session. |
sessionId | string | Requested ID for create, or target ID for close. Omit on create to generate a bounded session-N identifier. |
terminateDebuggee | boolean | For close only: request debugger termination of the live target before resetting/removing the session. |
debug_compare_runs
Compare bounded runtime evidence from two existing stopped DAP sessions. Use this for baseline or known-good versus candidate or failing differential debugging after both sessions have reached comparable stops. It compares stack identities, locals, registers, exception state, symbol health, and modules semantically; non-null raw address-only changes are marked unstable rather than causal evidence. Do not use it to launch, resume, or alter either target; prepare both runtime states with the normal lifecycle tools first.
| Parameter | Type | Description |
|---|---|---|
baselineSessionId * | string | Session representing the known-good or baseline runtime state. |
candidateSessionId * | string | Session representing the failing or changed runtime state. |
snapshot | object | Bounded evidence capture settings applied independently to both sessions. |
timeoutMs | integer | Aggregate deadline for collecting both snapshots. Cancellation propagates to pending DAP requests/event waits in this operation context. |
debug_snapshot Capture Runtime Debug Snapshot
Capture bounded evidence from the current stopped debug state without resuming execution. Use this when an agent needs raw stack, locals, registers, exception details, modules, or nearby instructions; prefer debug_diagnose_stop when you also want ranked crash hypotheses and project-frame selection. This is read-only with respect to the debuggee and returns best-effort evidence plus collection errors for optional data that an adapter cannot provide.
| Parameter | Type | Description |
|---|---|---|
disassembleAfter | integer | Number of instructions after the current instruction to request when disassembly is enabled. |
disassembleBefore | integer | Number of instructions before the current instruction to request when disassembly is enabled. |
includeDisassembly | boolean | Include best-effort instructions around the selected frame instruction pointer when supported. |
includeExceptionInfo | boolean | Include structured exception information for the stopped thread when the adapter supports it. |
includeModules | boolean | Include a bounded list of loaded executable images and libraries. |
maxVariablesPerScope | integer | Maximum variables returned per inspected scope, bounding output size. |
moduleCount | integer | Maximum loaded modules to return when includeModules is true. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
stackLevels | integer | Maximum number of stack frames to include, from the selected thread top downward. |
threadId | integer | Stopped DAP thread to inspect; omit to use the session-selected stopped thread. |
debug_status Debug Session Status
Inspect debugger lifecycle state, the selected stop, recent DAP events, and bounded adapter stderr without changing target execution. Use this to determine whether a session is initialized, running, stopped, postmortem, exited, or failed before choosing another debug tool; it is diagnostic only and does not resume, launch, attach, or terminate the debuggee.
debug_disconnect Disconnect Debugger
End the active DAP session and stop its local adapter process. Use this when debugging is finished or the session must be reset; do not call it when more runtime evidence is still needed. With terminateDebuggee=true it may also terminate a live target process, so this operation can destroy the current runtime state and cannot be treated as read-only.
| Parameter | Type | Description |
|---|---|---|
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
terminateDebuggee | boolean | Whether the debugger should terminate the live debuggee while disconnecting; set false to request detach/preserve behavior when the adapter supports it. |
debug_run_to_stop Run Until Debug Stop or Exit
Run one live launch or attach through an already initialized DAP adapter until the first stopped, exited, or terminated event. Use this when you need deterministic runtime evidence from a reproduction; do not use it for a postmortem dump or when executing/attaching to the local target is not authorized. Launch mode executes application code and attach mode changes debugger control of an existing process, so normal target side effects may occur before the stop. Returns the request result, terminal/stopped outcome, session status, and a bounded snapshot only when a stopped event is captured.
| Parameter | Type | Description |
|---|---|---|
configuration * | object | Adapter-specific DAP launch or attach configuration. |
breakpoints | array | Optional source breakpoint groups configured before the debugger completes launch/attach setup. |
request | string | Choose launch to start a new target from configuration, or attach to connect to an existing authorized local target. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
snapshot | object | Optional bounds and evidence categories for the snapshot captured only when execution stops. |
timeoutMs | integer | Maximum milliseconds to wait for the first stopped, exited, or terminated event. |
debug_diagnose_stop Diagnose Current Debug Stop
Diagnose an already stopped live or postmortem debug session without changing execution state. Use this when a debugger has captured the failure and you want project-frame selection, crash classification, operand/register/variable bindings, call-chain provenance, ranked hypotheses, and a fix/rebuild/reproduce/verify plan; use debug_snapshot instead when only raw evidence is needed. The tool is read-only and returns both the bounded snapshot and the derived diagnosis, including collection limitations when optional debugger evidence is unavailable.
| Parameter | Type | Description |
|---|---|---|
analysis | object | Hints used to distinguish project code from runtime, system, or third-party frames. |
disassembleAfter | integer | Number of instructions after the selected instruction to request. |
disassembleBefore | integer | Number of instructions before the selected instruction to request. |
includeDisassembly | boolean | Include best-effort disassembly around the selected instruction pointer when supported. |
includeExceptionInfo | boolean | Request structured exception information for the stopped thread when supported. |
includeModules | boolean | Include a bounded list of loaded executable images and libraries. |
maxVariablesPerScope | integer | Maximum variables returned per inspected scope, bounding evidence size. |
moduleCount | integer | Maximum loaded modules to include when module collection is enabled. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
stackLevels | integer | Maximum number of stack frames to inspect when collecting crash evidence. |
threadId | integer | Stopped DAP thread to inspect; omit to use the session-selected stopped thread. |
debug_source_disassembly Correlate Source and Disassembly
Correlate source locations, disassembly, registers, and pointer-like locals for the raw fault frame and the first likely project-controlled frame. Use this for low-level root-cause evidence when a crash is already stopped and instruction/operand provenance matters; prefer debug_diagnose_stop for a broader ranked diagnosis. This is read-only, does not resume the target, and returns frame-selection reasoning, both correlations, operand bindings, and any best-effort collection errors.
| Parameter | Type | Description |
|---|---|---|
analysis | object | Hints used to distinguish project code from runtime, system, or third-party frames. |
disassembleAfter | integer | Instructions after the selected instruction included in each disassembly window. |
disassembleBefore | integer | Instructions before the selected instruction included in each disassembly window. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
stackLevels | integer | Maximum stack frames considered while selecting the project-controlled frame. |
threadId | integer | Stopped DAP thread to inspect; omit to use the session-selected stopped thread. |
debug_this_crash Debug This Crash
Preferred high-level native crash workflow. Use mode=current for an already stopped session, dump for read-only postmortem analysis, codelldb to discover CodeLLDB, lldb-dap to discover upstream LLVM lldb-dap, gdb to discover GNU GDB built-in DAP interpreter, or live with an already initialized generic DAP adapter. Do not use codelldb/lldb-dap/gdb/live when executing or attaching to the target is not authorized: those modes can run application code and cause its normal side effects, while current/dump only inspect stopped evidence. workflow.stage selects initial diagnosis, verification against…
debug_causal_trace Trace Runtime Causality
Build a bounded consumer-to-writer evidence chain for one suspicious debugger-visible value. Use it after crash or differential evidence identifies a value whose runtime producers matter. It combines the current stopped snapshot with repeated watchpoint writer tracing. Do not use it for frozen dumps or unsafe-to-resume targets, and do not treat an observed writer as automatic proof of root cause.
| Parameter | Type | Description |
|---|---|---|
name * | string | Debugger-visible variable or expression whose producer chain should be traced. |
maxDepth | integer | Maximum number of confirmed writer events promoted into the causal producer chain. |
maxStops | integer | Maximum watchpoint stops available to the underlying bounded temporal trace. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
timeoutMs | integer | Aggregate deadline for the entire causal trace operation. |
debug_progress_probe Probe Runtime Progress
Sample a live target across short resume/pause intervals to distinguish no observed progress, same-frame execution movement, and probable busy loops. Use it when a process appears hung but a single thread snapshot cannot distinguish blocking from spinning. Do not use it when resuming the target is unsafe; sampling perturbs scheduling and is not proof of application-level progress.
| Parameter | Type | Description |
|---|---|---|
intervalMs | integer | Approximate execution interval between debugger samples. |
samples | integer | Number of stopped runtime samples to collect across resume/pause intervals. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
threadId | integer | Preferred thread to sample; omit to follow the debugger-selected stopped thread. |
debug_runtime_report Build Runtime Debug Report
Create a shareable structured report from the current stopped target with normalized crash fingerprinting, Symbol Doctor status, sanitizer stderr correlation, poison-pattern memory hazard detection, ABI register-to-argument mapping, and recent debugger output. Use it only for evidence-driven triage and issue handoff. Do not treat heuristic poison patterns, ABI mappings, or sanitizer text correlation as standalone proof.
| Parameter | Type | Description |
|---|---|---|
abi | string | ABI used to map argument registers; auto infers from debugger registers and host platform when possible. |
includeOutputTail | boolean | Include the bounded recent adapter stderr tail used for sanitizer correlation. |
redactPaths | boolean | Replace path-like portions of the report fingerprint frame key with a generic marker. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
debug_trace_lifetime Trace Object Lifetime
Trace lifetime evidence for one debugger-visible pointer or object handle using the current snapshot, sanitizer/runtime output, bounded forward writer tracing, and optional reverse stepping when supported. Use this for suspected use-after-free, stale ownership, or unexpected pointer replacement. Do not use forward tracing on a frozen dump or when resuming the target is unsafe.
| Parameter | Type | Description |
|---|---|---|
name * | string | Debugger-visible pointer/object expression whose lifetime should be investigated. |
direction | string | Forward uses writer watchpoints, reverse uses stepBack, and hybrid collects both when supported. |
maxStops | integer | Maximum forward writer observations. |
reverseSteps | integer | Maximum reverse stepBack operations when reverse or hybrid is selected. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
timeoutMs | integer | Aggregate bound for forward temporal tracing. |
debug_adaptive_evidence Collect Adaptive Runtime Evidence
Collect runtime evidence in progressively richer bounded phases instead of immediately requesting a maximal snapshot. Use it when token/DAP cost matters or the amount of evidence needed is unknown: it starts with stack and small locals, expands only when symbols, exception state, or variables are insufficient, and finishes with a full runtime report when needed. Do not use it to replace deliberate deep inspection when the required evidence is already known.
| Parameter | Type | Description |
|---|---|---|
forceFull | boolean | Force the full evidence phase even if the cheap snapshot already looks sufficient. |
maxVariables | integer | Maximum locals/registers per scope in the richest phase. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
debug_this_hang Debug This Hang
High-level native hang workflow for all-thread triage. Use it when a live process appears stuck, deadlocked, waiting forever, or spinning and you need bounded stacks from every thread, wait-state/deadlock heuristics, and cross-thread Pointer-Provenance v2. In current mode it inspects an existing configured session and pauses a running live target when necessary; codelldb, lldb-dap, gdb, and live modes can launch or attach to an authorized local target, observe it for a bounded interval, then pause it for evidence. Do not use executable/attach modes when target execution or debugger control is…
| Parameter | Type | Description |
|---|---|---|
adapterPath | string | Optional explicit CodeLLDB, lldb-dap, or GDB executable path; omit to use adapter discovery. |
analysis | object | Optional project roots/modules used to recognize project-controlled frames across all threads. |
args | array | Command-line arguments for codelldb/lldb-dap/gdb launch modes. |
captureTimeoutMs | integer | Global deadline for all-thread stack/scope/variable evidence collection after the pause phase. When it expires, remaining threads are retained as partial/unclassified evidence instead of extending the… |
configuration | object | Required only for mode=live: adapter-specific DAP launch/attach configuration. |
cwd | string | Working directory for adapter-owned launches and a project-root hint for hang triage. |
env | object | Environment variables supplied to adapter-owned launched programs. |
framesWithVariables | integer | Maximum frames per thread whose locals/arguments are collected, prioritizing the top frame and first project-controlled frame. |
maxThreads | integer | Maximum threads to collect for bounded all-thread triage. |
maxVariablesPerFrame | integer | Maximum local/argument variables collected per selected frame scope for Pointer-Provenance v2. |
mode | string | current triages the configured session; live uses an already initialized generic DAP adapter; codelldb/lldb-dap/gdb discover and start that adapter before launch/attach. |
observeMs | integer | Bounded interval after launch/attach during which a normal stop or process exit prevents automatic hang-timeout classification. |
pauseBudgetMs | integer | Aggregate wall-clock budget across thread enumeration and all pause requests. This prevents per-thread pause timeouts from multiplying across large thread sets. |
pauseTimeoutMs | integer | Maximum time to wait for any single pause request used to freeze a suspected live hang. |
pid | integer | Required for codelldb/lldb-dap/gdb attach modes; ignored for launch and generic live configuration. |
program | string | Required for codelldb/lldb-dap/gdb launch; optional executable image hint for adapter-specific attach. |
request | string | For live or adapter-owned modes, launch starts a program and attach connects to an existing authorized process. |
requestTimeoutMs | integer | Per-request timeout for starting and configuring an adapter-owned DAP session. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
stackLevels | integer | Maximum stack frames collected per thread. |
debug_find_writer Find Runtime Writer
Temporarily watch a variable or debugger expression, resume an authorized live target, and capture the first resulting stop to identify the immediate writer candidate. Use this after a stopped-state diagnosis suggests a value was corrupted and runtime provenance is needed; do not use it for crash dumps or when resuming is unsafe. Adapters with DAP data-breakpoint support use that protocol directly; GDB 14/15 uses a bounded watch/rwatch/awatch command through DAP REPL because those releases do not advertise native data breakpoints. The tool removes only the temporary watch it created and never…
| Parameter | Type | Description |
|---|---|---|
name * | string | Variable child name or debugger expression to watch. Without variablesReference, the expression is resolved in frameId/current frame when supported. GDB fallback expressions must not contain control c… |
accessType | string | Requested watchpoint access mode. write is the normal choice when finding who corrupts a value; GDB maps these to watch/rwatch/awatch. |
condition | string | Optional adapter-supported condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback. |
frameId | integer | Optional stopped frame used to resolve an expression; omit to use the current snapshot frame. Ignored by native DAP child resolution when variablesReference is supplied. |
hitCondition | string | Optional adapter-supported hit-count condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback. |
replaceExistingDataBreakpoints | boolean | For native DAP data breakpoints, temporarily replace existing MCP-managed watches when true. The GDB fallback never deletes unrelated CLI watchpoints and only removes its own temporary watch. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
snapshot | object | Bounds for the evidence snapshot captured after execution stops. |
threadId | integer | Stopped thread to resume and inspect; omit to use the debugger-selected stopped thread. |
timeoutMs | integer | Maximum time in milliseconds to wait for a stop, exit, or termination after resuming. |
variablesReference | integer | Optional DAP variable-container reference when the adapter advertises native data breakpoints. Omit for the GDB watch-command fallback and pass a debugger-visible expression in name instead. |
debug_trace_value Trace Runtime Value Writes
Build a bounded temporal write timeline for one debugger-visible variable or expression. Use this after differential or crash evidence identifies a suspicious value and repeated live-target resume is safe. The tool installs one temporary data breakpoint or watchpoint at a time, resumes to the next confirmed writer, captures bounded runtime evidence, removes only its own temporary watch, and repeats. Do not use it for crash dumps, unsafe-to-resume targets, or as proof that an observed writer is the root cause; it stops on unrelated debugger events rather than continuing through them.
| Parameter | Type | Description |
|---|---|---|
name * | string | Debugger-visible variable or expression to watch. Control characters and line breaks are rejected by the GDB fallback. |
accessType | string | Watch writes only by default; readWrite may be used when read access is also relevant. |
maxStops | integer | Maximum confirmed or unrelated writer-stop observations before the trace ends. |
perStopTimeoutMs | integer | Maximum bounded wait allocated to each individual writer observation, also capped by the aggregate deadline. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
snapshot | object | Optional bounded evidence settings for each observed writer stop. |
threadId | integer | Initial stopped thread; omit to use the debugger-selected stopped thread. Writer snapshots follow the actual stopped event thread. |
timeoutMs | integer | Aggregate operation deadline across the entire write timeline. |
debug_open_dump Open Native Crash Dump
Open a local native core/minidump with CodeLLDB, upstream LLVM lldb-dap, or GNU GDB DAP and capture bounded postmortem evidence. Use this when the failure is already recorded and no target process should execute; use debug_run_to_stop or debug_this_crash for a live reproduction instead. The tool starts only the selected local debugger adapter, never launches or resumes the crashed program, treats the dump as read-only, and returns the initial stack/locals/registers plus optional modules and disassembly.
| Parameter | Type | Description |
|---|---|---|
dumpPath * | string | Absolute or local path to the native core/minidump file to inspect. |
adapter | string | Debugger adapter used for postmortem inspection. lldb-dap and gdb use their native coreFile attach semantics. |
adapterPath | string | Optional explicit executable path for the selected debugger adapter; omit to use its normal discovery logic. |
cwd | string | Working directory for the local debugger adapter process; this does not execute the crashed target. |
includeDisassembly | boolean | Include best-effort instructions around the selected crash frame. |
includeModules | boolean | Include loaded executable images and libraries recorded in the dump. |
maxVariablesPerScope | integer | Maximum variables returned per scope in the initial snapshot. |
moduleCount | integer | Maximum number of modules to include when includeModules is true. |
program | string | Path to the matching executable image. Optional for CodeLLDB/GDB, but required when adapter=lldb-dap because LLVM coreFile loading binds the dump to its program image. |
requestTimeoutMs | integer | Per-request DAP timeout in milliseconds while opening and inspecting the dump. |
sessionId | string | Optional DAP session ID. Omit to use the backward-compatible default session. |
sourceMap | object | Optional mapping from source paths recorded in symbols to local source paths. Supported by CodeLLDB/lldb-dap; GDB currently rejects this field rather than guessing undocumented semantics. |
stackLevels | integer | Maximum stack frames to include in the initial postmortem snapshot. |
threadId | integer | Specific dump thread to inspect; omit to use the debugger-selected stopped/crashed thread. |