Qwen DAP MCP — C/C++ Debugger for Claude Code, Codex & Qwen

v0.19.4
io.github.spk-c/qwen-dap-mcp Checked 8 hours ago Published 28 days ago

C/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.

ParameterTypeDescription
actionstringManagement action: list current sessions, create a new isolated session, or close one session.
sessionIdstringRequested ID for create, or target ID for close. Omit on create to generate a bounded session-N identifier.
terminateDebuggeebooleanFor 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.

ParameterTypeDescription
baselineSessionId *stringSession representing the known-good or baseline runtime state.
candidateSessionId *stringSession representing the failing or changed runtime state.
snapshotobjectBounded evidence capture settings applied independently to both sessions.
timeoutMsintegerAggregate 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.

ParameterTypeDescription
disassembleAfterintegerNumber of instructions after the current instruction to request when disassembly is enabled.
disassembleBeforeintegerNumber of instructions before the current instruction to request when disassembly is enabled.
includeDisassemblybooleanInclude best-effort instructions around the selected frame instruction pointer when supported.
includeExceptionInfobooleanInclude structured exception information for the stopped thread when the adapter supports it.
includeModulesbooleanInclude a bounded list of loaded executable images and libraries.
maxVariablesPerScopeintegerMaximum variables returned per inspected scope, bounding output size.
moduleCountintegerMaximum loaded modules to return when includeModules is true.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
stackLevelsintegerMaximum number of stack frames to include, from the selected thread top downward.
threadIdintegerStopped 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.

ParameterTypeDescription
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
terminateDebuggeebooleanWhether 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.

ParameterTypeDescription
configuration *objectAdapter-specific DAP launch or attach configuration.
breakpointsarrayOptional source breakpoint groups configured before the debugger completes launch/attach setup.
requeststringChoose launch to start a new target from configuration, or attach to connect to an existing authorized local target.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
snapshotobjectOptional bounds and evidence categories for the snapshot captured only when execution stops.
timeoutMsintegerMaximum 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.

ParameterTypeDescription
analysisobjectHints used to distinguish project code from runtime, system, or third-party frames.
disassembleAfterintegerNumber of instructions after the selected instruction to request.
disassembleBeforeintegerNumber of instructions before the selected instruction to request.
includeDisassemblybooleanInclude best-effort disassembly around the selected instruction pointer when supported.
includeExceptionInfobooleanRequest structured exception information for the stopped thread when supported.
includeModulesbooleanInclude a bounded list of loaded executable images and libraries.
maxVariablesPerScopeintegerMaximum variables returned per inspected scope, bounding evidence size.
moduleCountintegerMaximum loaded modules to include when module collection is enabled.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
stackLevelsintegerMaximum number of stack frames to inspect when collecting crash evidence.
threadIdintegerStopped 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.

ParameterTypeDescription
analysisobjectHints used to distinguish project code from runtime, system, or third-party frames.
disassembleAfterintegerInstructions after the selected instruction included in each disassembly window.
disassembleBeforeintegerInstructions before the selected instruction included in each disassembly window.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
stackLevelsintegerMaximum stack frames considered while selecting the project-controlled frame.
threadIdintegerStopped 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.

ParameterTypeDescription
name *stringDebugger-visible variable or expression whose producer chain should be traced.
maxDepthintegerMaximum number of confirmed writer events promoted into the causal producer chain.
maxStopsintegerMaximum watchpoint stops available to the underlying bounded temporal trace.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
timeoutMsintegerAggregate 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.

ParameterTypeDescription
intervalMsintegerApproximate execution interval between debugger samples.
samplesintegerNumber of stopped runtime samples to collect across resume/pause intervals.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
threadIdintegerPreferred 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.

ParameterTypeDescription
abistringABI used to map argument registers; auto infers from debugger registers and host platform when possible.
includeOutputTailbooleanInclude the bounded recent adapter stderr tail used for sanitizer correlation.
redactPathsbooleanReplace path-like portions of the report fingerprint frame key with a generic marker.
sessionIdstringOptional 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.

ParameterTypeDescription
name *stringDebugger-visible pointer/object expression whose lifetime should be investigated.
directionstringForward uses writer watchpoints, reverse uses stepBack, and hybrid collects both when supported.
maxStopsintegerMaximum forward writer observations.
reverseStepsintegerMaximum reverse stepBack operations when reverse or hybrid is selected.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
timeoutMsintegerAggregate 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.

ParameterTypeDescription
forceFullbooleanForce the full evidence phase even if the cheap snapshot already looks sufficient.
maxVariablesintegerMaximum locals/registers per scope in the richest phase.
sessionIdstringOptional 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…

ParameterTypeDescription
adapterPathstringOptional explicit CodeLLDB, lldb-dap, or GDB executable path; omit to use adapter discovery.
analysisobjectOptional project roots/modules used to recognize project-controlled frames across all threads.
argsarrayCommand-line arguments for codelldb/lldb-dap/gdb launch modes.
captureTimeoutMsintegerGlobal 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…
configurationobjectRequired only for mode=live: adapter-specific DAP launch/attach configuration.
cwdstringWorking directory for adapter-owned launches and a project-root hint for hang triage.
envobjectEnvironment variables supplied to adapter-owned launched programs.
framesWithVariablesintegerMaximum frames per thread whose locals/arguments are collected, prioritizing the top frame and first project-controlled frame.
maxThreadsintegerMaximum threads to collect for bounded all-thread triage.
maxVariablesPerFrameintegerMaximum local/argument variables collected per selected frame scope for Pointer-Provenance v2.
modestringcurrent triages the configured session; live uses an already initialized generic DAP adapter; codelldb/lldb-dap/gdb discover and start that adapter before launch/attach.
observeMsintegerBounded interval after launch/attach during which a normal stop or process exit prevents automatic hang-timeout classification.
pauseBudgetMsintegerAggregate wall-clock budget across thread enumeration and all pause requests. This prevents per-thread pause timeouts from multiplying across large thread sets.
pauseTimeoutMsintegerMaximum time to wait for any single pause request used to freeze a suspected live hang.
pidintegerRequired for codelldb/lldb-dap/gdb attach modes; ignored for launch and generic live configuration.
programstringRequired for codelldb/lldb-dap/gdb launch; optional executable image hint for adapter-specific attach.
requeststringFor live or adapter-owned modes, launch starts a program and attach connects to an existing authorized process.
requestTimeoutMsintegerPer-request timeout for starting and configuring an adapter-owned DAP session.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
stackLevelsintegerMaximum 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…

ParameterTypeDescription
name *stringVariable 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…
accessTypestringRequested watchpoint access mode. write is the normal choice when finding who corrupts a value; GDB maps these to watch/rwatch/awatch.
conditionstringOptional adapter-supported condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback.
frameIdintegerOptional stopped frame used to resolve an expression; omit to use the current snapshot frame. Ignored by native DAP child resolution when variablesReference is supplied.
hitConditionstringOptional adapter-supported hit-count condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback.
replaceExistingDataBreakpointsbooleanFor 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.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
snapshotobjectBounds for the evidence snapshot captured after execution stops.
threadIdintegerStopped thread to resume and inspect; omit to use the debugger-selected stopped thread.
timeoutMsintegerMaximum time in milliseconds to wait for a stop, exit, or termination after resuming.
variablesReferenceintegerOptional 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.

ParameterTypeDescription
name *stringDebugger-visible variable or expression to watch. Control characters and line breaks are rejected by the GDB fallback.
accessTypestringWatch writes only by default; readWrite may be used when read access is also relevant.
maxStopsintegerMaximum confirmed or unrelated writer-stop observations before the trace ends.
perStopTimeoutMsintegerMaximum bounded wait allocated to each individual writer observation, also capped by the aggregate deadline.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
snapshotobjectOptional bounded evidence settings for each observed writer stop.
threadIdintegerInitial stopped thread; omit to use the debugger-selected stopped thread. Writer snapshots follow the actual stopped event thread.
timeoutMsintegerAggregate 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.

ParameterTypeDescription
dumpPath *stringAbsolute or local path to the native core/minidump file to inspect.
adapterstringDebugger adapter used for postmortem inspection. lldb-dap and gdb use their native coreFile attach semantics.
adapterPathstringOptional explicit executable path for the selected debugger adapter; omit to use its normal discovery logic.
cwdstringWorking directory for the local debugger adapter process; this does not execute the crashed target.
includeDisassemblybooleanInclude best-effort instructions around the selected crash frame.
includeModulesbooleanInclude loaded executable images and libraries recorded in the dump.
maxVariablesPerScopeintegerMaximum variables returned per scope in the initial snapshot.
moduleCountintegerMaximum number of modules to include when includeModules is true.
programstringPath 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.
requestTimeoutMsintegerPer-request DAP timeout in milliseconds while opening and inspecting the dump.
sessionIdstringOptional DAP session ID. Omit to use the backward-compatible default session.
sourceMapobjectOptional 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.
stackLevelsintegerMaximum stack frames to include in the initial postmortem snapshot.
threadIdintegerSpecific dump thread to inspect; omit to use the debugger-selected stopped/crashed thread.