watch_variable
Trace all writes to any C++ variable by evaluating its expression. Obtain a complete write history to understand value changes during execution.
Instructions
Get the complete write history of a C++ variable. Evaluates the expression to find its memory address, then traces all writes. Simpler than manually using evaluate + watchpoint_history.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>",
"type": "<type>"
},
"name": "watch_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | C++ expression for the variable, e.g. "this->mURI" or "aLoadState" | |
| type | Yes | C++ type of the value, e.g. "uint64_t", "int32_t", "nsCOMPtr<nsIURI>" | |
| limit | No | Max results per direction (default 100) |