Expand description
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.
Types, command parameters and event payloads for the Debugger
domain. The method-name constants for the same domain are in
crate::methods.
Structs§
- Break
Location - Breakpoint
Resolved Event - Fired when breakpoint is resolved to an actual script and location.
Deprecated in favor of
resolvedBreakpointsin thescriptParsedevent. - Call
Frame - JavaScript call frame. Array of call frames form the call stack.
- Continue
ToLocation Params - Continues execution until specific location is reached.
- Debug
Symbols - Debug symbols available for a wasm script.
- Disable
Params - Disables debugger for given page.
- Disassemble
Wasm Module Params - Experimental: may change without notice.
- Disassemble
Wasm Module Returns - What
Debugger.disassembleWasmModuleanswers with. - Enable
Params - Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
- Enable
Returns - What
Debugger.enableanswers with. - Evaluate
OnCall Frame Params - Evaluates expression on a given call frame.
- Evaluate
OnCall Frame Returns - What
Debugger.evaluateOnCallFrameanswers with. - GetPossible
Breakpoints Params - Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
- GetPossible
Breakpoints Returns - What
Debugger.getPossibleBreakpointsanswers with. - GetScript
Source Params - Returns source for the script with given id.
- GetScript
Source Returns - What
Debugger.getScriptSourceanswers with. - GetStack
Trace Params - Returns stack trace with given
stackTraceId. - GetStack
Trace Returns - What
Debugger.getStackTraceanswers with. - GetWasm
Bytecode Params - This command is deprecated. Use getScriptSource instead.
- GetWasm
Bytecode Returns - What
Debugger.getWasmBytecodeanswers with. - Location
- Location in the source code.
- Location
Range - Location range within one script.
- Next
Wasm Disassembly Chunk Params - Disassemble the next chunk of lines for the module corresponding to the stream. If disassembly is complete, this API will invalidate the streamId and return an empty chunk. Any subsequent calls for the now invalid stream will return errors.
- Next
Wasm Disassembly Chunk Returns - What
Debugger.nextWasmDisassemblyChunkanswers with. - Pause
OnAsync Call Params - Deprecated in the protocol.
- Pause
Params - Stops on the next JavaScript statement.
- Paused
Event - Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
- Remove
Breakpoint Params - Removes JavaScript breakpoint.
- Resolved
Breakpoint - Restart
Frame Params - Restarts particular call frame from the beginning. The old, deprecated
behavior of
restartFrameis 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,restartFramenow expects amodeparameter to be present. If themodeparameter is missing,restartFrameerrors out. The various return values are deprecated andcallFramesis always empty. Use the call frames from theDebugger#pausedevents instead, that fires once V8 pauses at the beginning of the restarted function. - Restart
Frame Returns - What
Debugger.restartFrameanswers with. - Resume
Params - Resumes JavaScript execution.
- Resumed
Event - Fired when the virtual machine resumed execution.
- Scope
- Scope description.
- Script
Failed ToParse Event - Fired when virtual machine fails to parse the script.
- Script
Parsed Event - Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
- Script
Position - Location in the source code.
- Search
InContent Params - Searches for given string in script content.
- Search
InContent Returns - What
Debugger.searchInContentanswers with. - Search
Match - Search match for resource.
- SetAsync
Call Stack Depth Params - Enables or disables async call stacks tracking.
- SetBlackbox
Execution Contexts Params - Replace previous blackbox execution contexts with passed ones. Forces backend to skip stepping/pausing in scripts in these execution contexts. VM will try to leave blackboxed script by performing ‘step in’ several times, finally resorting to ‘step out’ if unsuccessful.
- SetBlackbox
Patterns Params - Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing ‘step in’ several times, finally resorting to ‘step out’ if unsuccessful.
- SetBlackboxed
Ranges Params - Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing ‘step in’ several times, finally resorting to ‘step out’ if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn’t blackboxed. Array should be sorted.
- SetBreakpoint
ByUrl Params - Sets JavaScript breakpoint at given location specified either by URL or
URL regex. Once this command is issued, all existing parsed scripts will
have breakpoints resolved and returned in
locationsproperty. Further matching script parsing will result in subsequentbreakpointResolvedevents issued. This logical breakpoint will survive page reloads. - SetBreakpoint
ByUrl Returns - What
Debugger.setBreakpointByUrlanswers with. - SetBreakpoint
OnFunction Call Params - Sets JavaScript breakpoint before each call to the given function. If another function was created from the same source as a given one, calling it will also trigger the breakpoint.
- SetBreakpoint
OnFunction Call Returns - What
Debugger.setBreakpointOnFunctionCallanswers with. - SetBreakpoint
Params - Sets JavaScript breakpoint at a given location.
- SetBreakpoint
Returns - What
Debugger.setBreakpointanswers with. - SetBreakpoints
Active Params - Activates / deactivates all breakpoints on the page.
- SetInstrumentation
Breakpoint Params - Sets instrumentation breakpoint.
- SetInstrumentation
Breakpoint Returns - What
Debugger.setInstrumentationBreakpointanswers with. - SetPause
OnExceptions Params - Defines pause on exceptions state. Can be set to stop on all exceptions,
uncaught exceptions, or caught exceptions, no exceptions. Initial pause on
exceptions state is
none. - SetReturn
Value Params - Changes return value in top frame. Available only at return break position.
- SetScript
Source Params - Live edit is no longer supported and this command always fails with a “no longer available” error.
- SetScript
Source Returns - What
Debugger.setScriptSourceanswers with. - SetSkip
AllPauses Params - Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
- SetVariable
Value Params - Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
- Step
Into Params - Steps into the function call.
- Step
OutParams - Steps out of the function call.
- Step
Over Params - Steps over the statement.
- Wasm
Disassembly Chunk - Experimental: may change without notice.
Enums§
- Break
Location Type - The values
typeaccepts onBreakLocation. - Continue
ToLocation Target Call Frames - The values
targetCallFramesaccepts oncontinueToLocation. - Debug
Symbols Type - The values
typeaccepts onDebugSymbols. - Paused
Reason - The values
reasonaccepts onpaused. - Restart
Frame Mode - The values
modeaccepts onrestartFrame. - Scope
Empty Reason - The values
emptyReasonaccepts onScope. - Scope
Type - The values
typeaccepts onScope. - Script
Language - Enum of possible script languages.
- SetInstrumentation
Breakpoint Instrumentation - The values
instrumentationaccepts onsetInstrumentationBreakpoint. - SetPause
OnExceptions State - The values
stateaccepts onsetPauseOnExceptions. - SetScript
Source Status - The values
statusaccepts onsetScriptSource.
Type Aliases§
- Breakpoint
Id - Breakpoint identifier.
- Call
Frame Id - Call frame identifier.