Find Runtime Writer
debug_find_writerFind the writer that corrupts a variable: temporarily watch the expression, resume the live target, and capture the first stop to reveal the responsible code.
Instructions
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 automatically continues through an unrelated stop.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 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 characters or line breaks. | |
| frameId | No | 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. | |
| snapshot | No | Bounds for the evidence snapshot captured after execution stops. | |
| threadId | No | Stopped thread to resume and inspect; omit to use the debugger-selected stopped thread. | |
| condition | No | Optional adapter-supported condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback. | |
| sessionId | No | Optional DAP session ID. Omit to use the backward-compatible default session. | |
| timeoutMs | No | Maximum time in milliseconds to wait for a stop, exit, or termination after resuming. | |
| accessType | No | Requested watchpoint access mode. write is the normal choice when finding who corrupts a value; GDB maps these to watch/rwatch/awatch. | write |
| hitCondition | No | Optional adapter-supported hit-count condition for native DAP data breakpoints. Intentionally rejected by the bounded GDB fallback. | |
| variablesReference | No | 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. | |
| replaceExistingDataBreakpoints | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| before | Yes | ||
| status | Yes | ||
| outcome | Yes | ||
| guidance | Yes | ||
| snapshot | No | ||
| strategy | Yes | ||
| installed | Yes | ||
| resolution | Yes | ||
| writerFrame | No | ||
| hitConfirmed | Yes | ||
| cleanupWarning | No | ||
| writerCorrelation | No | ||
| priorDataBreakpointCount | Yes | ||
| replaceExistingDataBreakpoints | Yes |