← Back to Debugger domain
Debugger.restartFrame
Restarts particular call frame from the beginning. The old, deprecated
behavior of `restartFrame` is to stay paused and allow further CDP commands
after a restart was scheduled. This can cause problems with restarting, so
we now continue execution immediatly after it has been scheduled until we
reach the beginning of the restarted frame.
To stay back-wards compatible, `restartFrame` now expects a `mode`
parameter to be present. If the `mode` parameter is missing, `restartFrame`
errors out.
The various return values are deprecated and `callFrames` is always empty.
Use the call frames from the `Debugger#paused` events instead, that fires
once V8 pauses at the beginning of the restarted function.
Domain: Debugger
stable
Parameters
| Name | Type | Description |
callFrameId | CallFrameId | Call frame identifier to evaluate on. |
mode (optional) | string | The `mode` parameter must be present and set to 'StepInto', otherwise
`restartFrame` will error out. |
Returns
| Name | Type | Description |
callFrames | array | New stack trace. |
asyncStackTrace | Runtime.StackTrace | Async stack trace, if any. |
asyncStackTraceId | Runtime.StackTraceId | Async stack trace, if any. |
Example Request
{
"id": 1,
"method": "Debugger.restartFrame",
"params": {
"callFrameId": "0"
}
}
Example Response
{
"id": 1,
"result": {
"callFrames": [],
"asyncStackTrace": "asyncStackTrace-value",
"asyncStackTraceId": "asyncStackTraceId-value"
}
}
Usage in Node.js
const result = await send('Debugger.restartFrame', {"callFrameId": "0"});
console.log(result);
// {"callFrames": [], "asyncStackTrace": "asyncStackTrace-value", "asyncStackTraceId": "asyncStackTraceId-value"}