Class DebuggerAdapter
Represents an adapter for the Debugger domain to simplify the command interface.
public class DebuggerAdapter
- Inheritance
-
DebuggerAdapter
- Inherited Members
Constructors
DebuggerAdapter(IDevToolsSession)
Initializes a new instance of the DebuggerAdapter class.
public DebuggerAdapter(IDevToolsSession session)
Parameters
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
Methods
ContinueToLocation(ContinueToLocationCommandSettings, CancellationToken, int?, bool)
Continues execution until specific location is reached.
public Task<ContinueToLocationCommandResponse?> ContinueToLocation(ContinueToLocationCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandContinueToLocationCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Disable(DisableCommandSettings?, CancellationToken, int?, bool)
Disables debugger for given page.
public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
DisassembleWasmModule(DisassembleWasmModuleCommandSettings, CancellationToken, int?, bool)
disassembleWasmModule
public Task<DisassembleWasmModuleCommandResponse> DisassembleWasmModule(DisassembleWasmModuleCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDisassembleWasmModuleCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Enable(EnableCommandSettings, CancellationToken, int?, bool)
Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
public Task<EnableCommandResponse> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
EvaluateOnCallFrame(EvaluateOnCallFrameCommandSettings, CancellationToken, int?, bool)
Evaluates expression on a given call frame.
public Task<EvaluateOnCallFrameCommandResponse> EvaluateOnCallFrame(EvaluateOnCallFrameCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandEvaluateOnCallFrameCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetPossibleBreakpoints(GetPossibleBreakpointsCommandSettings, CancellationToken, int?, bool)
Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
public Task<GetPossibleBreakpointsCommandResponse> GetPossibleBreakpoints(GetPossibleBreakpointsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetPossibleBreakpointsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetScriptSource(GetScriptSourceCommandSettings, CancellationToken, int?, bool)
Returns source for the script with given id.
public Task<GetScriptSourceCommandResponse> GetScriptSource(GetScriptSourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetScriptSourceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetStackTrace(GetStackTraceCommandSettings, CancellationToken, int?, bool)
Returns stack trace with given stackTraceId.
public Task<GetStackTraceCommandResponse> GetStackTrace(GetStackTraceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetStackTraceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
GetWasmBytecode(GetWasmBytecodeCommandSettings, CancellationToken, int?, bool)
This command is deprecated. Use getScriptSource instead.
public Task<GetWasmBytecodeCommandResponse> GetWasmBytecode(GetWasmBytecodeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandGetWasmBytecodeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
NextWasmDisassemblyChunk(NextWasmDisassemblyChunkCommandSettings, CancellationToken, int?, bool)
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.
public Task<NextWasmDisassemblyChunkCommandResponse> NextWasmDisassemblyChunk(NextWasmDisassemblyChunkCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandNextWasmDisassemblyChunkCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Pause(PauseCommandSettings?, CancellationToken, int?, bool)
Stops on the next JavaScript statement.
public Task<PauseCommandResponse?> Pause(PauseCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandPauseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
PauseOnAsyncCall(PauseOnAsyncCallCommandSettings, CancellationToken, int?, bool)
pauseOnAsyncCall
public Task<PauseOnAsyncCallCommandResponse?> PauseOnAsyncCall(PauseOnAsyncCallCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandPauseOnAsyncCallCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
RemoveBreakpoint(RemoveBreakpointCommandSettings, CancellationToken, int?, bool)
Removes JavaScript breakpoint.
public Task<RemoveBreakpointCommandResponse?> RemoveBreakpoint(RemoveBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandRemoveBreakpointCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
RestartFrame(RestartFrameCommandSettings, CancellationToken, int?, bool)
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.
public Task<RestartFrameCommandResponse> RestartFrame(RestartFrameCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandRestartFrameCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Resume(ResumeCommandSettings, CancellationToken, int?, bool)
Resumes JavaScript execution.
public Task<ResumeCommandResponse?> Resume(ResumeCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandResumeCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SearchInContent(SearchInContentCommandSettings, CancellationToken, int?, bool)
Searches for given string in script content.
public Task<SearchInContentCommandResponse> SearchInContent(SearchInContentCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSearchInContentCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetAsyncCallStackDepth(SetAsyncCallStackDepthCommandSettings, CancellationToken, int?, bool)
Enables or disables async call stacks tracking.
public Task<SetAsyncCallStackDepthCommandResponse?> SetAsyncCallStackDepth(SetAsyncCallStackDepthCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetAsyncCallStackDepthCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBlackboxExecutionContexts(SetBlackboxExecutionContextsCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetBlackboxExecutionContextsCommandResponse?> SetBlackboxExecutionContexts(SetBlackboxExecutionContextsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBlackboxExecutionContextsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBlackboxPatterns(SetBlackboxPatternsCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetBlackboxPatternsCommandResponse?> SetBlackboxPatterns(SetBlackboxPatternsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBlackboxPatternsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBlackboxedRanges(SetBlackboxedRangesCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetBlackboxedRangesCommandResponse?> SetBlackboxedRanges(SetBlackboxedRangesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBlackboxedRangesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBreakpoint(SetBreakpointCommandSettings, CancellationToken, int?, bool)
Sets JavaScript breakpoint at a given location.
public Task<SetBreakpointCommandResponse> SetBreakpoint(SetBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBreakpointCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBreakpointByUrl(SetBreakpointByUrlCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetBreakpointByUrlCommandResponse> SetBreakpointByUrl(SetBreakpointByUrlCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBreakpointByUrlCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBreakpointOnFunctionCall(SetBreakpointOnFunctionCallCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetBreakpointOnFunctionCallCommandResponse> SetBreakpointOnFunctionCall(SetBreakpointOnFunctionCallCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBreakpointOnFunctionCallCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetBreakpointsActive(SetBreakpointsActiveCommandSettings, CancellationToken, int?, bool)
Activates / deactivates all breakpoints on the page.
public Task<SetBreakpointsActiveCommandResponse?> SetBreakpointsActive(SetBreakpointsActiveCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetBreakpointsActiveCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetInstrumentationBreakpoint(SetInstrumentationBreakpointCommandSettings, CancellationToken, int?, bool)
Sets instrumentation breakpoint.
public Task<SetInstrumentationBreakpointCommandResponse> SetInstrumentationBreakpoint(SetInstrumentationBreakpointCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetInstrumentationBreakpointCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetPauseOnExceptions(SetPauseOnExceptionsCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetPauseOnExceptionsCommandResponse?> SetPauseOnExceptions(SetPauseOnExceptionsCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetPauseOnExceptionsCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetReturnValue(SetReturnValueCommandSettings, CancellationToken, int?, bool)
Changes return value in top frame. Available only at return break position.
public Task<SetReturnValueCommandResponse?> SetReturnValue(SetReturnValueCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetReturnValueCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetScriptSource(SetScriptSourceCommandSettings, CancellationToken, int?, bool)
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.
public Task<SetScriptSourceCommandResponse> SetScriptSource(SetScriptSourceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetScriptSourceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetSkipAllPauses(SetSkipAllPausesCommandSettings, CancellationToken, int?, bool)
Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
public Task<SetSkipAllPausesCommandResponse?> SetSkipAllPauses(SetSkipAllPausesCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetSkipAllPausesCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetVariableValue(SetVariableValueCommandSettings, CancellationToken, int?, bool)
Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
public Task<SetVariableValueCommandResponse?> SetVariableValue(SetVariableValueCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetVariableValueCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StepInto(StepIntoCommandSettings, CancellationToken, int?, bool)
Steps into the function call.
public Task<StepIntoCommandResponse?> StepInto(StepIntoCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStepIntoCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StepOut(StepOutCommandSettings?, CancellationToken, int?, bool)
Steps out of the function call.
public Task<StepOutCommandResponse?> StepOut(StepOutCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStepOutCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StepOver(StepOverCommandSettings, CancellationToken, int?, bool)
Steps over the statement.
public Task<StepOverCommandResponse?> StepOver(StepOverCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStepOverCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Events
BreakpointResolved
Fired when breakpoint is resolved to an actual script and location.
Deprecated in favor of resolvedBreakpoints in the scriptParsed event.
public event EventHandler<BreakpointResolvedEventArgs>? BreakpointResolved
Event Type
Paused
Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
public event EventHandler<PausedEventArgs>? Paused
Event Type
Resumed
Fired when the virtual machine resumed execution.
public event EventHandler<ResumedEventArgs>? Resumed
Event Type
ScriptFailedToParse
Fired when virtual machine fails to parse the script.
public event EventHandler<ScriptFailedToParseEventArgs>? ScriptFailedToParse
Event Type
ScriptParsed
Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
public event EventHandler<ScriptParsedEventArgs>? ScriptParsed