Skip to main content

Module debugger

Module debugger 

Source
Expand description

Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.

Method names for the Debugger domain, for use with CdpClient::call.

Constants§

CONTINUE_TO_LOCATION
Continues execution until specific location is reached.
DISABLE
Disables debugger for given page.
DISASSEMBLE_WASM_MODULE
Debugger.disassembleWasmModule
ENABLE
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
EVALUATE_ON_CALL_FRAME
Evaluates expression on a given call frame.
GET_POSSIBLE_BREAKPOINTS
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
GET_SCRIPT_SOURCE
Returns source for the script with given id.
GET_STACK_TRACE
Returns stack trace with given stackTraceId.
GET_WASM_BYTECODE
This command is deprecated. Use getScriptSource instead.
NEXT_WASM_DISASSEMBLY_CHUNK
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.
PAUSE
Stops on the next JavaScript statement.
PAUSE_ON_ASYNC_CALL
Debugger.pauseOnAsyncCall
REMOVE_BREAKPOINT
Removes JavaScript breakpoint.
RESTART_FRAME
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.
RESUME
Resumes JavaScript execution.
SEARCH_IN_CONTENT
Searches for given string in script content.
SET_ASYNC_CALL_STACK_DEPTH
Enables or disables async call stacks tracking.
SET_BLACKBOXED_RANGES
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.
SET_BLACKBOX_EXECUTION_CONTEXTS
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.
SET_BLACKBOX_PATTERNS
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.
SET_BREAKPOINT
Sets JavaScript breakpoint at a given location.
SET_BREAKPOINTS_ACTIVE
Activates / deactivates all breakpoints on the page.
SET_BREAKPOINT_BY_URL
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 locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads.
SET_BREAKPOINT_ON_FUNCTION_CALL
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.
SET_INSTRUMENTATION_BREAKPOINT
Sets instrumentation breakpoint.
SET_PAUSE_ON_EXCEPTIONS
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.
SET_RETURN_VALUE
Changes return value in top frame. Available only at return break position.
SET_SCRIPT_SOURCE
Edits JavaScript source live. In general, functions that are currently on the stack can not be edited with a single exception: If the edited function is the top-most stack frame and that is the only activation of that function on the stack. In this case the live edit will be successful and a Debugger.restartFrame for the top-most function is automatically triggered.
SET_SKIP_ALL_PAUSES
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
SET_VARIABLE_VALUE
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
STEP_INTO
Steps into the function call.
STEP_OUT
Steps out of the function call.
STEP_OVER
Steps over the statement.