watch
Set a watchpoint to halt execution when an expression's value changes. Used to detect data modifications like memory corruption or unexpected variable mutations.
Instructions
Set a watchpoint that stops execution when an expression changes (GDB 'watch').
Watchpoints detect when data changes, not where execution reaches. Useful for tracking memory corruption, unexpected variable mutations, etc.
expression: any GDB expression — variable, memory location, dereferenced pointer e.g. "x", "buf[4]", "*0x601020", "obj->field" mode: "write" — stop when expression is written (default, GDB 'watch') "read" — stop when expression is read (GDB 'rwatch') "access" — stop on any read or write (GDB 'awatch')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | write | |
| expression | Yes | ||
| session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |