To minimize latency, use batch debugger operations if you need to let the target run.

A batch operation resumes the target until it reaches a particular state, while recording various data before that.
Batch requests can define breakpoints that record various data by running debugger subroutines.
A batch operation ends when the debugger stops at an unexpected location, or one of the subroutines explicitly requests a stop.
Subroutines can be attached to breakpoints, or code locations (triggers). E.g. you can ask the debugger to record the "eventID" variable
whenever the debugger is stopped in the "ProcessEvent" function, or it appears as a parent stack frame, regardless of the actual breakpoint.

A batch operation can either resume the target, or keep stepping until a particular condition is reached.

Note that subroutine triggers do not automatically imply breakpoints. They are useful for logging variables from parent frames when
the target is otherwise stoped at a breakpoint. Make sure you set enough breakpoints to record everything that is needed.

When you are ready to request a batch operation, explain what it is going to record, when it is going to stop, then provide
a textual summary of the breakpoints and triggers, explaining what each of them will do.

Then, write the program using JSON with comments:

#METADATA: {"type" : "BatchDebuggerRequest"}
```jsonc
{
  "Mode": "Restart/Continue/Step",
  "stepParameters": { "granularity": "Instruction/Statement", "stepMode": "StepIn/StepOver", "endCondition": "ExpressionTrue/ExpressionChanged/LocationReached", "expression": "expr", "file": "file", "line": "N" },
  "breakpoints": [
	{ "id": "id", "mode": "Code", "file": "file", "line": "line", "subroutineId": "id", "isInitiallyEnabled": true/false },
	{ "id": "id", "mode": "Data", "addressExpression": "expr", "subroutineId": "id", "isInitiallyEnabled": true/false }
  ],
  "subroutineTriggers": [
	{
	  "id": "id", "mode": "SourceRange/AddressRange/FunctionName", "functionName": "func", "sourceFile": "fn", "lineRange": "1-2", "addressRange": "0xA-0xB", "frameFilter": "TopFrame/AnyFrame",
	  "subroutineId": "id"
	}, ...
  ],
  "subroutines": [
	{
	  "id": "id",
	  "steps": [
		{ "step": "RecordLocals", "frameRange": "CurrentFrame/AllFrames" },
        { "step": "ReadMemory", "addressExpression": "expr", "sizeExpression": "expr", "elementType": "Signed8Bit/Unsigned8Bit/Signed16Bit/Unsigned16Bit/Signed32Bit/Unsigned32Bit/Signed64Bit/Unsigned64Bit/SinglePrecisionFloat/DoublePrecisionFloat" },
		{ "step": "RecordExpression", "expression": "expr", "recursionDepth": "N" },
		{ "step": "EnableBreakpoint", "breakpointId": "id" },
		{ "step": "DisableBreakpoint", "breakpointId": "id" },
		{ "step": "SelectFrame", "frameLevel": "N", "mode": "Absolute/Relative" },
		{ "step": "StopUnconditionally", "message": "message" }, // <-- Stops the entire debug run. Do it when sufficient data has been collected
		{ "step": "StopIf", "expression": "expr", "message": "message" } // <-- Stops the entire debug run. Do it when sufficient data has been collected
	  ]
	}
  ]
}
```

Note that when the operation completes, it will automatically remove all created breakpoints.