public interface Debugger
| Modifier and Type | Method and Description |
|---|---|
void |
continueToLocation(Location location)
Continues execution until specific location is reached.
|
void |
continueToLocation(Location location,
ContinueToLocationTargetCallFrames targetCallFrames)
Continues execution until specific location is reached.
|
void |
disable()
Disables debugger for given page.
|
String |
enable()
Enables debugger for the given page.
|
String |
enable(Double maxScriptsCacheSize)
Enables debugger for the given page.
|
EvaluateOnCallFrame |
evaluateOnCallFrame(String callFrameId,
String expression)
Evaluates expression on a given call frame.
|
EvaluateOnCallFrame |
evaluateOnCallFrame(String callFrameId,
String expression,
String objectGroup,
Boolean includeCommandLineAPI,
Boolean silent,
Boolean returnByValue,
Boolean generatePreview,
Boolean throwOnSideEffect,
Double timeout)
Evaluates expression on a given call frame.
|
List<BreakLocation> |
getPossibleBreakpoints(Location start)
Returns possible locations for breakpoint.
|
List<BreakLocation> |
getPossibleBreakpoints(Location start,
Location end,
Boolean restrictToFunction)
Returns possible locations for breakpoint.
|
ScriptSource |
getScriptSource(String scriptId)
Returns source for the script with given id.
|
StackTrace |
getStackTrace(StackTraceId stackTraceId)
Returns stack trace with given `stackTraceId`.
|
String |
getWasmBytecode(String scriptId)
Deprecated.
|
EventListener |
onBreakpointResolved(EventHandler<BreakpointResolved> eventListener)
Fired when breakpoint is resolved to an actual script and location.
|
EventListener |
onPaused(EventHandler<Paused> eventListener)
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
|
EventListener |
onResumed(EventHandler<Resumed> eventListener)
Fired when the virtual machine resumed execution.
|
EventListener |
onScriptFailedToParse(EventHandler<ScriptFailedToParse> eventListener)
Fired when virtual machine fails to parse the script.
|
EventListener |
onScriptParsed(EventHandler<ScriptParsed> eventListener)
Fired when virtual machine parses script.
|
void |
pause()
Stops on the next JavaScript statement.
|
void |
pauseOnAsyncCall(StackTraceId parentStackTraceId)
Deprecated.
|
void |
removeBreakpoint(String breakpointId)
Removes JavaScript breakpoint.
|
RestartFrame |
restartFrame(String callFrameId)
Restarts particular call frame from the beginning.
|
void |
resume()
Resumes JavaScript execution.
|
void |
resume(Boolean terminateOnResume)
Resumes JavaScript execution.
|
List<SearchMatch> |
searchInContent(String scriptId,
String query)
Searches for given string in script content.
|
List<SearchMatch> |
searchInContent(String scriptId,
String query,
Boolean caseSensitive,
Boolean isRegex)
Searches for given string in script content.
|
void |
setAsyncCallStackDepth(Integer maxDepth)
Enables or disables async call stacks tracking.
|
void |
setBlackboxedRanges(String scriptId,
List<ScriptPosition> positions)
Makes backend skip steps in the script in blackboxed ranges.
|
void |
setBlackboxPatterns(List<String> patterns)
Replace previous blackbox patterns with passed ones.
|
SetBreakpoint |
setBreakpoint(Location location)
Sets JavaScript breakpoint at a given location.
|
SetBreakpoint |
setBreakpoint(Location location,
String condition)
Sets JavaScript breakpoint at a given location.
|
SetBreakpointByUrl |
setBreakpointByUrl(Integer lineNumber)
Sets JavaScript breakpoint at given location specified either by URL or URL regex.
|
SetBreakpointByUrl |
setBreakpointByUrl(Integer lineNumber,
String url,
String urlRegex,
String scriptHash,
Integer columnNumber,
String condition)
Sets JavaScript breakpoint at given location specified either by URL or URL regex.
|
String |
setBreakpointOnFunctionCall(String objectId)
Sets JavaScript breakpoint before each call to the given function.
|
String |
setBreakpointOnFunctionCall(String objectId,
String condition)
Sets JavaScript breakpoint before each call to the given function.
|
void |
setBreakpointsActive(Boolean active)
Activates / deactivates all breakpoints on the page.
|
String |
setInstrumentationBreakpoint(SetInstrumentationBreakpointInstrumentation instrumentation)
Sets instrumentation breakpoint.
|
void |
setPauseOnExceptions(SetPauseOnExceptionsState state)
Defines pause on exceptions state.
|
void |
setReturnValue(CallArgument newValue)
Changes return value in top frame.
|
SetScriptSource |
setScriptSource(String scriptId,
String scriptSource)
Edits JavaScript source live.
|
SetScriptSource |
setScriptSource(String scriptId,
String scriptSource,
Boolean dryRun)
Edits JavaScript source live.
|
void |
setSkipAllPauses(Boolean skip)
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
|
void |
setVariableValue(Integer scopeNumber,
String variableName,
CallArgument newValue,
String callFrameId)
Changes value of variable in a callframe.
|
void |
stepInto()
Steps into the function call.
|
void |
stepInto(Boolean breakOnAsyncCall,
List<LocationRange> skipList)
Steps into the function call.
|
void |
stepOut()
Steps out of the function call.
|
void |
stepOver()
Steps over the statement.
|
void |
stepOver(List<LocationRange> skipList)
Steps over the statement.
|
void continueToLocation(Location location)
location - Location to continue to.void continueToLocation(Location location, ContinueToLocationTargetCallFrames targetCallFrames)
location - Location to continue to.targetCallFrames - void disable()
String enable()
String enable(Double maxScriptsCacheSize)
maxScriptsCacheSize - The maximum size in bytes of collected scripts (not referenced by
other heap objects) the debugger can hold. Puts no limit if paramter is omitted.EvaluateOnCallFrame evaluateOnCallFrame(String callFrameId, String expression)
callFrameId - Call frame identifier to evaluate on.expression - Expression to evaluate.EvaluateOnCallFrame evaluateOnCallFrame(String callFrameId, String expression, String objectGroup, Boolean includeCommandLineAPI, Boolean silent, Boolean returnByValue, Boolean generatePreview, Boolean throwOnSideEffect, Double timeout)
callFrameId - Call frame identifier to evaluate on.expression - Expression to evaluate.objectGroup - String object group name to put result into (allows rapid releasing
resulting object handles using `releaseObjectGroup`).includeCommandLineAPI - Specifies whether command line API should be available to the
evaluated expression, defaults to false.silent - In silent mode exceptions thrown during evaluation are not reported and do not
pause execution. Overrides `setPauseOnException` state.returnByValue - Whether the result is expected to be a JSON object that should be sent by
value.generatePreview - Whether preview should be generated for the result.throwOnSideEffect - Whether to throw an exception if side effect cannot be ruled out
during evaluation.timeout - Terminate execution after timing out (number of milliseconds).List<BreakLocation> getPossibleBreakpoints(Location start)
start - Start of range to search possible breakpoint locations in.List<BreakLocation> getPossibleBreakpoints(Location start, Location end, Boolean restrictToFunction)
start - Start of range to search possible breakpoint locations in.end - End of range to search possible breakpoint locations in (excluding). When not
specified, end of scripts is used as end of range.restrictToFunction - Only consider locations which are in the same (non-nested) function
as start.ScriptSource getScriptSource(String scriptId)
scriptId - Id of the script to get source for.@Deprecated String getWasmBytecode(String scriptId)
scriptId - Id of the Wasm script to get source for.StackTrace getStackTrace(StackTraceId stackTraceId)
stackTraceId - void pause()
@Deprecated void pauseOnAsyncCall(StackTraceId parentStackTraceId)
parentStackTraceId - Debugger will pause when async call with given stack trace is
started.void removeBreakpoint(String breakpointId)
breakpointId - RestartFrame restartFrame(String callFrameId)
callFrameId - Call frame identifier to evaluate on.void resume()
void resume(Boolean terminateOnResume)
terminateOnResume - Set to true to terminate execution upon resuming execution. In
contrast to Runtime.terminateExecution, this will allows to execute further JavaScript
(i.e. via evaluation) until execution of the paused code is actually resumed, at which
point termination is triggered. If execution is currently not paused, this parameter has no
effect.List<SearchMatch> searchInContent(String scriptId, String query)
scriptId - Id of the script to search in.query - String to search for.List<SearchMatch> searchInContent(String scriptId, String query, Boolean caseSensitive, Boolean isRegex)
scriptId - Id of the script to search in.query - String to search for.caseSensitive - If true, search is case sensitive.isRegex - If true, treats string parameter as regex.void setAsyncCallStackDepth(Integer maxDepth)
maxDepth - Maximum depth of async call stacks. Setting to `0` will effectively disable
collecting async call stacks (default).void setBlackboxPatterns(List<String> patterns)
patterns - Array of regexps that will be used to check script url for blackbox state.void setBlackboxedRanges(String scriptId, List<ScriptPosition> positions)
scriptId - Id of the script.positions - SetBreakpoint setBreakpoint(Location location)
location - Location to set breakpoint in.SetBreakpoint setBreakpoint(Location location, String condition)
location - Location to set breakpoint in.condition - Expression to use as a breakpoint condition. When specified, debugger will
only stop on the breakpoint if this expression evaluates to true.String setInstrumentationBreakpoint(SetInstrumentationBreakpointInstrumentation instrumentation)
instrumentation - Instrumentation name.SetBreakpointByUrl setBreakpointByUrl(Integer lineNumber)
lineNumber - Line number to set breakpoint at.SetBreakpointByUrl setBreakpointByUrl(Integer lineNumber, String url, String urlRegex, String scriptHash, Integer columnNumber, String condition)
lineNumber - Line number to set breakpoint at.url - URL of the resources to set breakpoint on.urlRegex - Regex pattern for the URLs of the resources to set breakpoints on. Either `url`
or `urlRegex` must be specified.scriptHash - Script hash of the resources to set breakpoint on.columnNumber - Offset in the line to set breakpoint at.condition - Expression to use as a breakpoint condition. When specified, debugger will
only stop on the breakpoint if this expression evaluates to true.String setBreakpointOnFunctionCall(String objectId)
objectId - Function object id.String setBreakpointOnFunctionCall(String objectId, String condition)
objectId - Function object id.condition - Expression to use as a breakpoint condition. When specified, debugger will
stop on the breakpoint if this expression evaluates to true.void setBreakpointsActive(Boolean active)
active - New value for breakpoints active state.void setPauseOnExceptions(SetPauseOnExceptionsState state)
state - Pause on exceptions mode.void setReturnValue(CallArgument newValue)
newValue - New return value.SetScriptSource setScriptSource(String scriptId, String scriptSource)
scriptId - Id of the script to edit.scriptSource - New content of the script.SetScriptSource setScriptSource(String scriptId, String scriptSource, Boolean dryRun)
scriptId - Id of the script to edit.scriptSource - New content of the script.dryRun - If true the change will not actually be applied. Dry run may be used to get
result description without actually modifying the code.void setSkipAllPauses(Boolean skip)
skip - New value for skip pauses state.void setVariableValue(Integer scopeNumber, String variableName, CallArgument newValue, String callFrameId)
scopeNumber - 0-based number of scope as was listed in scope chain. Only 'local',
'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.variableName - Variable name.newValue - New variable value.callFrameId - Id of callframe that holds variable.void stepInto()
void stepInto(Boolean breakOnAsyncCall, List<LocationRange> skipList)
breakOnAsyncCall - Debugger will pause on the execution of the first async task which was
scheduled before next pause.skipList - The skipList specifies location ranges that should be skipped on step into.void stepOut()
void stepOver()
void stepOver(List<LocationRange> skipList)
skipList - The skipList specifies location ranges that should be skipped on step over.EventListener onBreakpointResolved(EventHandler<BreakpointResolved> eventListener)
EventListener onPaused(EventHandler<Paused> eventListener)
EventListener onResumed(EventHandler<Resumed> eventListener)
EventListener onScriptFailedToParse(EventHandler<ScriptFailedToParse> eventListener)
EventListener onScriptParsed(EventHandler<ScriptParsed> eventListener)
Copyright © 2021 Kenan Klisura. All rights reserved.