Record Replay Protocol

Methods

Target.convertFunctionOffsetsToLocations

Get all the locations to use for some offsets in a function. This can be implemented more efficiently by some targets than when separate convertFunctionOffsetToLocation commands are used.

parameters
functionId
string

Function ID shared by all the offsets.

offsets
array[ integer ]

Sorted array of offsets to compute the locations for.

Return Object
locations
array[ Debugger.Location ]

Resulting locations, with the same length as offsets.

Target.convertFunctionOffsetToLocation

Get the location to use for a function ID / offset.

parameters
functionId
string
offset
integer
Return Object
location
Debugger.Location

Target.convertLocationToFunctionOffset

Get the function ID / offset to use for a source location, if there is one.

parameters
location
Debugger.Location
Return Object
functionId
string
offset
integer

Target.countStackFrames

Count the number of stack frames on the stack. This is equivalent to using the size of the stack returned by Pause.getAllFrames, but can be implemented more efficiently.

Return Object
count
integer

Target.currentGeneratorId

If the topmost frame on the stack is a generator frame which can be popped and pushed on the stack repeatedly, return a unique ID for the frame which will be consistent across each of those pops and pushes.

Return Object
id
integer

Target.evaluatePrivileged

Evaluate a string in an application specific environment with privileged access to inspect the runtime's state.

parameters
expression
string

Expression to evaluate.

allowSideEffects
boolean

Whether side effects are allowed during this evaluation, per RecordReplayAllowSideEffects().

Return Object
result
object

Result of the evaluation, must be JSON-stringifiable.

Target.getCapabilities

Query the target for general information about what capabilities it supports.

Return Object
capabilities
Capabilities

Target.getCurrentMessageContents

This command might be sent from within a RecordReplayOnConsoleMessage() call to get contents of the new message. Properties in the result have the same meaning as for Console.Message.

Return Object
source
Console.MessageSource
level
Console.MessageLevel
text
string
url
string
sourceId
Debugger.SourceId
line
integer
column
integer
argumentValues
array[ Pause.Value ]

Target.getCurrentNetworkRequestEvent

This command might be sent from within a RecordReplayOnNetworkRequestEvent() call to get contents of the request data.

Return Object
data
Network.RequestEvent

Target.getCurrentNetworkStreamData

Fetch the current data entry for a given driver OnNetworkStreamData call.

parameters
index
number

The start index within the value to fetch.

length
number

The amount of data to fetch.

Return Object
data
NetworkStreamData

The stream data available at the current location.

Target.getFunctionsInRange

Get the IDs of all functions in a range within a source.

parameters
sourceId
Debugger.SourceId
begin
Debugger.SourceLocation
end
Debugger.SourceLocation
Return Object
functions
array[ string ]

Target.getHTMLSource

Get the most complete contents known for an HTML file.

parameters
url
string
Return Object
contents
string

Target.getPossibleBreakpointsForMultipleSources

This command is used, when supported by the target runtime, to collect all possible breakpoints for all sources of a given region in one batch. This is an optimization over sending one Debugger.getPossibleBreakpoints command for each source.

parameters
sourceIds
array[ SourceId ]
Return Object
possibleBreakpoints
array[ PossibleBreakpointsForSource ]

Target.getSheetSourceMapURL

Get any source map URL associated with a style sheet.

parameters
sheet
Pause.ObjectId
Return Object
url
string
baseUrl
string

Target.getSourceMapURL

Get any source map URL associated with a source.

parameters
sourceId
Debugger.SourceId
Return Object
url
string
baseUrl
string

Target.getStackFunctionIDs

Get the IDs of the functions for all stack frames, ordered from topmost to bottommost.

Return Object
frameFunctions
array[ string ]

Target.getStepOffsets

Get the offsets at which execution should pause when stepping around within a frame for a function.

parameters
functionId
string
Return Object
offsets
array[ integer ]

Offsets at which execution should stop when stepping. This is a subset of the breakpoint locations in the function, and may be omitted if execution should stop at all breakpoint locations.

Target.topFrameLocation

Get the location of the top frame on the stack, if there is one.

Return Object
location
Debugger.Location

Types

Target.Capabilities

The various capabilities supported by a target.

Type: object

properties
pureEval
boolean

True if the target supports the 'pure' parameter. If this is not set, attempts at pure evaluation will not pass the command to the target.

Target.NetworkStreamData

Represents the data pieces returned from a network stream. Always "data" for now but we'll likely add more in the future to support Websockets.

Type: object

properties
kind
"data"

A tagged-union identifier for this data type.

value
string

A string containing the data.

Target.PossibleBreakpointsForSource

Type: object

properties
sourceId
SourceId
lineLocations
array[ Debugger.SameLineSourceLocations ]