listWatchpoints
View active memory watchpoints in the VICE C64 emulator to monitor specific memory addresses during debugging sessions.
Instructions
List all active memory watchpoints.
Shows watchpoint IDs, address ranges, type (load/store), and status.
Related tools: setWatchpoint, deleteBreakpoint, listBreakpoints
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:773-802 (handler)Primary MCP tool handler for 'listWatchpoints'. Calls ViceClient.listWatchpoints(), handles empty list, formats output with hex addresses and metadata hints.async () => { const watchpoints = client.listWatchpoints(); if (watchpoints.length === 0) { return formatResponse({ count: 0, watchpoints: [], hint: "No watchpoints set. Use setWatchpoint() to add one.", }); } return formatResponse({ count: watchpoints.length, watchpoints: watchpoints.map((wp) => ({ id: wp.id, startAddress: { value: wp.startAddress, hex: `$${wp.startAddress.toString(16).padStart(4, "0")}`, }, endAddress: { value: wp.endAddress, hex: `$${wp.endAddress.toString(16).padStart(4, "0")}`, }, type: wp.type, enabled: wp.enabled, temporary: wp.temporary, })), hint: `${watchpoints.length} watchpoint(s) active. Use deleteBreakpoint(id) to remove (works for both breakpoints and watchpoints).`, }); }
- src/index.ts:764-803 (registration)MCP server registration of the 'listWatchpoints' tool, including description and handler reference.server.registerTool( "listWatchpoints", { description: `List all active memory watchpoints. Shows watchpoint IDs, address ranges, type (load/store), and status. Related tools: setWatchpoint, deleteBreakpoint, listBreakpoints`, }, async () => { const watchpoints = client.listWatchpoints(); if (watchpoints.length === 0) { return formatResponse({ count: 0, watchpoints: [], hint: "No watchpoints set. Use setWatchpoint() to add one.", }); } return formatResponse({ count: watchpoints.length, watchpoints: watchpoints.map((wp) => ({ id: wp.id, startAddress: { value: wp.startAddress, hex: `$${wp.startAddress.toString(16).padStart(4, "0")}`, }, endAddress: { value: wp.endAddress, hex: `$${wp.endAddress.toString(16).padStart(4, "0")}`, }, type: wp.type, enabled: wp.enabled, temporary: wp.temporary, })), hint: `${watchpoints.length} watchpoint(s) active. Use deleteBreakpoint(id) to remove (works for both breakpoints and watchpoints).`, }); } );
- src/protocol/client.ts:22-31 (schema)Type definitions for CheckpointInfo (return type of listWatchpoints) and CheckpointType used throughout checkpoint/watchpoint operations.export type CheckpointType = "exec" | "load" | "store"; export interface CheckpointInfo { id: number; startAddress: number; endAddress: number; enabled: boolean; temporary: boolean; type: CheckpointType; }
- src/protocol/client.ts:685-687 (helper)ViceClient helper method implementing listWatchpoints by filtering non-execution checkpoints (watchpoints) from local checkpoints Map.listWatchpoints(): CheckpointInfo[] { return Array.from(this.checkpoints.values()).filter((cp) => cp.type !== "exec"); }