debugger

package
v0.158.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 3 Imported by: 18

Documentation

Overview

Package debugger provides the Chrome DevTools Protocol commands, types, and events for the Debugger domain.

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

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandContinueToLocation           = "Debugger.continueToLocation"
	CommandDisable                      = "Debugger.disable"
	CommandEnable                       = "Debugger.enable"
	CommandEvaluateOnCallFrame          = "Debugger.evaluateOnCallFrame"
	CommandGetPossibleBreakpoints       = "Debugger.getPossibleBreakpoints"
	CommandGetScriptSource              = "Debugger.getScriptSource"
	CommandDisassembleWasmModule        = "Debugger.disassembleWasmModule"
	CommandNextWasmDisassemblyChunk     = "Debugger.nextWasmDisassemblyChunk"
	CommandGetStackTrace                = "Debugger.getStackTrace"
	CommandPause                        = "Debugger.pause"
	CommandRemoveBreakpoint             = "Debugger.removeBreakpoint"
	CommandRestartFrame                 = "Debugger.restartFrame"
	CommandResume                       = "Debugger.resume"
	CommandSearchInContent              = "Debugger.searchInContent"
	CommandSetAsyncCallStackDepth       = "Debugger.setAsyncCallStackDepth"
	CommandSetBlackboxExecutionContexts = "Debugger.setBlackboxExecutionContexts"
	CommandSetBlackboxPatterns          = "Debugger.setBlackboxPatterns"
	CommandSetBlackboxedRanges          = "Debugger.setBlackboxedRanges"
	CommandSetBreakpoint                = "Debugger.setBreakpoint"
	CommandSetInstrumentationBreakpoint = "Debugger.setInstrumentationBreakpoint"
	CommandSetBreakpointByURL           = "Debugger.setBreakpointByUrl"
	CommandSetBreakpointOnFunctionCall  = "Debugger.setBreakpointOnFunctionCall"
	CommandSetBreakpointsActive         = "Debugger.setBreakpointsActive"
	CommandSetPauseOnExceptions         = "Debugger.setPauseOnExceptions"
	CommandSetReturnValue               = "Debugger.setReturnValue"
	CommandSetSkipAllPauses             = "Debugger.setSkipAllPauses"
	CommandSetVariableValue             = "Debugger.setVariableValue"
	CommandStepInto                     = "Debugger.stepInto"
	CommandStepOut                      = "Debugger.stepOut"
	CommandStepOver                     = "Debugger.stepOver"
)

Command names.

Variables

ContinueToLocation continues execution until specific location is reached.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-continueToLocation

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disables debugger for given page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-disable

DisassembleWasmModule [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-enable

EvaluateOnCallFrame evaluates expression on a given call frame.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-evaluateOnCallFrame

GetPossibleBreakpoints returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-getPossibleBreakpoints

GetScriptSource returns source for the script with given id.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-getScriptSource

GetStackTrace returns stack trace with given stackTraceId.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-getStackTrace

NextWasmDisassemblyChunk 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-nextWasmDisassemblyChunk

Pause stops on the next JavaScript statement.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-pause

View Source
var Paused = cdp.Event[EventPaused]{Method: "Debugger.paused"}

Paused fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-paused

RemoveBreakpoint removes JavaScript breakpoint.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-removeBreakpoint

RestartFrame 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 immediately 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-restartFrame

Resume resumes JavaScript execution.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-resume

View Source
var Resumed = cdp.Event[EventResumed]{Method: "Debugger.resumed"}

Resumed fired when the virtual machine resumed execution.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-resumed

View Source
var ScriptFailedToParse = cdp.Event[EventScriptFailedToParse]{Method: "Debugger.scriptFailedToParse"}

ScriptFailedToParse fired when virtual machine fails to parse the script.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-scriptFailedToParse

View Source
var ScriptParsed = cdp.Event[EventScriptParsed]{Method: "Debugger.scriptParsed"}

ScriptParsed fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-scriptParsed

SearchInContent searches for given string in script content.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-searchInContent

SetAsyncCallStackDepth enables or disables async call stacks tracking.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setAsyncCallStackDepth

SetBlackboxExecutionContexts 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBlackboxExecutionContexts

SetBlackboxPatterns 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBlackboxPatterns

SetBlackboxedRanges 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBlackboxedRanges

SetBreakpoint sets JavaScript breakpoint at a given location.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBreakpoint

SetBreakpointByURL 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBreakpointByUrl

SetBreakpointOnFunctionCall 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBreakpointOnFunctionCall

SetBreakpointsActive activates / deactivates all breakpoints on the page.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setBreakpointsActive

SetInstrumentationBreakpoint sets instrumentation breakpoint.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setInstrumentationBreakpoint

SetPauseOnExceptions 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.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setPauseOnExceptions

SetReturnValue changes return value in top frame. Available only at return break position.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setReturnValue

SetSkipAllPauses makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setSkipAllPauses

SetVariableValue changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setVariableValue

StepInto steps into the function call.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-stepInto

View Source
var StepOut = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandStepOut}

StepOut steps out of the function call.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-stepOut

StepOver steps over the statement.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-stepOver

Functions

This section is empty.

Types

type BreakLocation

type BreakLocation struct {
	ScriptID     cdp.ScriptID      `json:"scriptId"`                        // Script identifier as reported in the Debugger.scriptParsed.
	LineNumber   int64             `json:"lineNumber"`                      // Line number in the script (0-based).
	ColumnNumber int64             `json:"columnNumber,omitempty,omitzero"` // Column number in the script (0-based).
	Type         BreakLocationType `json:"type,omitempty,omitzero"`
}

BreakLocation [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-BreakLocation

type BreakLocationType added in v0.157.1

type BreakLocationType string

BreakLocationType [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-BreakLocation

const (
	BreakLocationTypeDebuggerStatement BreakLocationType = "debuggerStatement"
	BreakLocationTypeCall              BreakLocationType = "call"
	BreakLocationTypeReturn            BreakLocationType = "return"
)

BreakLocationType values.

func (BreakLocationType) String added in v0.157.1

func (t BreakLocationType) String() string

String returns the BreakLocationType as string value.

type BreakpointID

type BreakpointID string

BreakpointID breakpoint identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-BreakpointId

func (BreakpointID) String

func (t BreakpointID) String() string

String returns the BreakpointID as string value.

type CallFrame

type CallFrame struct {
	CallFrameID      CallFrameID           `json:"callFrameId"`                         // Call frame identifier. This identifier is only valid while the virtual machine is paused.
	FunctionName     string                `json:"functionName"`                        // Name of the JavaScript function called on this call frame.
	FunctionLocation *Location             `json:"functionLocation,omitempty,omitzero"` // Location in the source code.
	Location         *Location             `json:"location"`                            // Location in the source code.
	ScopeChain       []*Scope              `json:"scopeChain"`                          // Scope chain for this call frame.
	This             *runtime.RemoteObject `json:"this"`                                // this object for this call frame.
	ReturnValue      *runtime.RemoteObject `json:"returnValue,omitempty,omitzero"`      // The value being returned, if the function is at return point.
	CanBeRestarted   bool                  `json:"canBeRestarted"`                      // Valid only while the VM is paused and indicates whether this frame can be restarted or not. Note that a true value here does not guarantee that Debugger#restartFrame with this CallFrameId will be successful, but it is very likely.
}

CallFrame JavaScript call frame. Array of call frames form the call stack.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-CallFrame

type CallFrameID

type CallFrameID string

CallFrameID call frame identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-CallFrameId

func (CallFrameID) String

func (t CallFrameID) String() string

String returns the CallFrameID as string value.

type ContinueToLocationParams

type ContinueToLocationParams struct {
	Location         *Location                          `json:"location"` // Location to continue to.
	TargetCallFrames ContinueToLocationTargetCallFrames `json:"targetCallFrames,omitempty,omitzero"`
}

ContinueToLocationParams are the parameters of the command Debugger.continueToLocation.

type ContinueToLocationTargetCallFrames added in v0.157.1

type ContinueToLocationTargetCallFrames string

ContinueToLocationTargetCallFrames [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-continueToLocation

const (
	ContinueToLocationTargetCallFramesAny     ContinueToLocationTargetCallFrames = "any"
	ContinueToLocationTargetCallFramesCurrent ContinueToLocationTargetCallFrames = "current"
)

ContinueToLocationTargetCallFrames values.

func (ContinueToLocationTargetCallFrames) String added in v0.157.1

String returns the ContinueToLocationTargetCallFrames as string value.

type DebugSymbols

type DebugSymbols struct {
	Type        DebugSymbolsType `json:"type"`                           // Type of the debug symbols.
	ExternalURL string           `json:"externalURL,omitempty,omitzero"` // URL of the external symbol source.
}

DebugSymbols debug symbols available for a wasm script.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-DebugSymbols

type DebugSymbolsType added in v0.157.1

type DebugSymbolsType string

DebugSymbolsType type of the debug symbols.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-DebugSymbols

const (
	DebugSymbolsTypeSourceMap     DebugSymbolsType = "SourceMap"
	DebugSymbolsTypeEmbeddedDWARF DebugSymbolsType = "EmbeddedDWARF"
	DebugSymbolsTypeExternalDWARF DebugSymbolsType = "ExternalDWARF"
)

DebugSymbolsType values.

func (DebugSymbolsType) String added in v0.157.1

func (t DebugSymbolsType) String() string

String returns the DebugSymbolsType as string value.

type DisassembleWasmModuleParams

type DisassembleWasmModuleParams struct {
	ScriptID cdp.ScriptID `json:"scriptId"` // Id of the script to disassemble
}

DisassembleWasmModuleParams are the parameters of the command Debugger.disassembleWasmModule.

type DisassembleWasmModuleResult added in v0.157.3

type DisassembleWasmModuleResult struct {
	StreamID            string                `json:"streamId,omitempty,omitzero"`            // For large modules, return a stream from which additional chunks of disassembly can be read successively.
	TotalNumberOfLines  int64                 `json:"totalNumberOfLines,omitempty,omitzero"`  // The total number of lines in the disassembly text.
	FunctionBodyOffsets []int64               `json:"functionBodyOffsets,omitempty,omitzero"` // The offsets of all function bodies, in the format [start1, end1, start2, end2, ...] where all ends are exclusive.
	Chunk               *WasmDisassemblyChunk `json:"chunk,omitempty,omitzero"`               // The first chunk of disassembly.
}

DisassembleWasmModuleResult is the result of the command Debugger.disassembleWasmModule.

type EnableParams

type EnableParams struct {
	MaxScriptsCacheSize float64 `json:"maxScriptsCacheSize,omitempty,omitzero"` // The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if parameter is omitted.
}

EnableParams are the parameters of the command Debugger.enable.

type EnableResult added in v0.157.3

type EnableResult struct {
	DebuggerID cdp.UniqueDebuggerID `json:"debuggerId,omitempty,omitzero"` // Unique identifier of the debugger.
}

EnableResult is the result of the command Debugger.enable.

type EvaluateOnCallFrameParams

type EvaluateOnCallFrameParams struct {
	CallFrameID           CallFrameID       `json:"callFrameId"`                              // Call frame identifier to evaluate on.
	Expression            string            `json:"expression"`                               // Expression to evaluate.
	ObjectGroup           string            `json:"objectGroup,omitempty,omitzero"`           // String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup).
	IncludeCommandLineAPI *bool             `json:"includeCommandLineAPI,omitempty,omitzero"` // Specifies whether command line API should be available to the evaluated expression, defaults to false.
	Silent                *bool             `json:"silent,omitempty,omitzero"`                // In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state.
	ReturnByValue         *bool             `json:"returnByValue,omitempty,omitzero"`         // Whether the result is expected to be a JSON object that should be sent by value.
	GeneratePreview       *bool             `json:"generatePreview,omitempty,omitzero"`       // Whether preview should be generated for the result.
	ThrowOnSideEffect     *bool             `json:"throwOnSideEffect,omitempty,omitzero"`     // Whether to throw an exception if side effect cannot be ruled out during evaluation.
	Timeout               runtime.TimeDelta `json:"timeout,omitempty,omitzero"`               // Terminate execution after timing out (number of milliseconds).
	ScopeNumber           int64             `json:"scopeNumber,omitempty,omitzero"`           // Specifies the scope number to evaluate the expression in (default: 0, innermost scope).
}

EvaluateOnCallFrameParams are the parameters of the command Debugger.evaluateOnCallFrame.

type EvaluateOnCallFrameResult added in v0.157.3

type EvaluateOnCallFrameResult struct {
	Result           *runtime.RemoteObject     `json:"result,omitempty,omitzero"`           // Object wrapper for the evaluation result.
	ExceptionDetails *runtime.ExceptionDetails `json:"exceptionDetails,omitempty,omitzero"` // Exception details.
}

EvaluateOnCallFrameResult is the result of the command Debugger.evaluateOnCallFrame.

type EventPaused

type EventPaused struct {
	CallFrames        []*CallFrame          `json:"callFrames"` // Call stack the virtual machine stopped on.
	Reason            PausedReason          `json:"reason"`     // Pause reason.
	Data              jsonv2.Value          `json:"data,omitempty,omitzero"`
	HitBreakpoints    []string              `json:"hitBreakpoints,omitempty,omitzero"`    // Hit breakpoints IDs
	AsyncStackTrace   *runtime.StackTrace   `json:"asyncStackTrace,omitempty,omitzero"`   // Async stack trace, if any.
	AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty,omitzero"` // Async stack trace, if any.
}

EventPaused fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-paused

type EventResumed

type EventResumed struct{}

EventResumed fired when the virtual machine resumed execution.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-resumed

type EventScriptFailedToParse

type EventScriptFailedToParse struct {
	ScriptID                cdp.ScriptID               `json:"scriptId"`           // Identifier of the script parsed.
	URL                     string                     `json:"url"`                // URL or name of the script parsed (if any).
	StartLine               int64                      `json:"startLine"`          // Line offset of the script within the resource with given URL (for script tags).
	StartColumn             int64                      `json:"startColumn"`        // Column offset of the script within the resource with given URL.
	EndLine                 int64                      `json:"endLine"`            // Last line of the script.
	EndColumn               int64                      `json:"endColumn"`          // Length of the last line of the script.
	ExecutionContextID      runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context.
	Hash                    string                     `json:"hash"`               // Content hash of the script, SHA-256.
	BuildID                 string                     `json:"buildId"`            // For Wasm modules, the content of the build_id custom section. For JavaScript the debugId magic comment.
	ExecutionContextAuxData jsonv2.Value               `json:"executionContextAuxData,omitempty,omitzero"`
	SourceMapURL            string                     `json:"sourceMapURL,omitempty,omitzero"`   // URL of source map associated with script (if any).
	HasSourceURL            bool                       `json:"hasSourceURL"`                      // True, if this script has sourceURL.
	IsModule                bool                       `json:"isModule"`                          // True, if this script is ES6 module.
	Length                  int64                      `json:"length,omitempty,omitzero"`         // This script length.
	StackTrace              *runtime.StackTrace        `json:"stackTrace,omitempty,omitzero"`     // JavaScript top stack frame of where the script parsed event was triggered if available.
	CodeOffset              int64                      `json:"codeOffset,omitempty,omitzero"`     // If the scriptLanguage is WebAssembly, the code section offset in the module.
	ScriptLanguage          ScriptLanguage             `json:"scriptLanguage,omitempty,omitzero"` // The language of the script.
	EmbedderName            string                     `json:"embedderName,omitempty,omitzero"`   // The name the embedder supplied for this script.
}

EventScriptFailedToParse fired when virtual machine fails to parse the script.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-scriptFailedToParse

type EventScriptParsed

type EventScriptParsed struct {
	ScriptID                cdp.ScriptID               `json:"scriptId"`           // Identifier of the script parsed.
	URL                     string                     `json:"url"`                // URL or name of the script parsed (if any).
	StartLine               int64                      `json:"startLine"`          // Line offset of the script within the resource with given URL (for script tags).
	StartColumn             int64                      `json:"startColumn"`        // Column offset of the script within the resource with given URL.
	EndLine                 int64                      `json:"endLine"`            // Last line of the script.
	EndColumn               int64                      `json:"endColumn"`          // Length of the last line of the script.
	ExecutionContextID      runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context.
	Hash                    string                     `json:"hash"`               // Content hash of the script, SHA-256.
	BuildID                 string                     `json:"buildId"`            // For Wasm modules, the content of the build_id custom section. For JavaScript the debugId magic comment.
	ExecutionContextAuxData jsonv2.Value               `json:"executionContextAuxData,omitempty,omitzero"`
	IsLiveEdit              bool                       `json:"isLiveEdit"`                             // True, if this script is generated as a result of the live edit operation.
	SourceMapURL            string                     `json:"sourceMapURL,omitempty,omitzero"`        // URL of source map associated with script (if any).
	HasSourceURL            bool                       `json:"hasSourceURL"`                           // True, if this script has sourceURL.
	IsModule                bool                       `json:"isModule"`                               // True, if this script is ES6 module.
	Length                  int64                      `json:"length,omitempty,omitzero"`              // This script length.
	StackTrace              *runtime.StackTrace        `json:"stackTrace,omitempty,omitzero"`          // JavaScript top stack frame of where the script parsed event was triggered if available.
	CodeOffset              int64                      `json:"codeOffset,omitempty,omitzero"`          // If the scriptLanguage is WebAssembly, the code section offset in the module.
	ScriptLanguage          ScriptLanguage             `json:"scriptLanguage,omitempty,omitzero"`      // The language of the script.
	DebugSymbols            []*DebugSymbols            `json:"debugSymbols,omitempty,omitzero"`        // If the scriptLanguage is WebAssembly, the source of debug symbols for the module.
	EmbedderName            string                     `json:"embedderName,omitempty,omitzero"`        // The name the embedder supplied for this script.
	ResolvedBreakpoints     []*ResolvedBreakpoint      `json:"resolvedBreakpoints,omitempty,omitzero"` // The list of set breakpoints in this script if calls to setBreakpointByUrl matches this script's URL or hash. Clients that use this list can ignore the breakpointResolved event. They are equivalent.
}

EventScriptParsed fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-scriptParsed

type GetPossibleBreakpointsParams

type GetPossibleBreakpointsParams struct {
	Start              *Location `json:"start"`                                 // Start of range to search possible breakpoint locations in.
	End                *Location `json:"end,omitempty,omitzero"`                // End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
	RestrictToFunction *bool     `json:"restrictToFunction,omitempty,omitzero"` // Only consider locations which are in the same (non-nested) function as start.
}

GetPossibleBreakpointsParams are the parameters of the command Debugger.getPossibleBreakpoints.

type GetPossibleBreakpointsResult added in v0.157.3

type GetPossibleBreakpointsResult struct {
	Locations []*BreakLocation `json:"locations,omitempty,omitzero"` // List of the possible breakpoint locations.
}

GetPossibleBreakpointsResult is the result of the command Debugger.getPossibleBreakpoints.

type GetScriptSourceParams

type GetScriptSourceParams struct {
	ScriptID cdp.ScriptID `json:"scriptId"` // Id of the script to get source for.
}

GetScriptSourceParams are the parameters of the command Debugger.getScriptSource.

type GetScriptSourceResult added in v0.157.3

type GetScriptSourceResult struct {
	ScriptSource string `json:"scriptSource,omitempty,omitzero"` // Script source (empty in case of Wasm bytecode).
	Bytecode     []byte `json:"bytecode,omitempty,omitzero"`     // Wasm bytecode.
}

GetScriptSourceResult is the result of the command Debugger.getScriptSource.

type GetStackTraceParams

type GetStackTraceParams struct {
	StackTraceID *runtime.StackTraceID `json:"stackTraceId"`
}

GetStackTraceParams are the parameters of the command Debugger.getStackTrace.

type GetStackTraceResult added in v0.157.3

type GetStackTraceResult struct {
	StackTrace *runtime.StackTrace `json:"stackTrace,omitempty,omitzero"`
}

GetStackTraceResult is the result of the command Debugger.getStackTrace.

type Location

type Location struct {
	ScriptID     cdp.ScriptID `json:"scriptId"`                        // Script identifier as reported in the Debugger.scriptParsed.
	LineNumber   int64        `json:"lineNumber"`                      // Line number in the script (0-based).
	ColumnNumber *int64       `json:"columnNumber,omitempty,omitzero"` // Column number in the script (0-based).
}

Location location in the source code.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-Location

type LocationRange

type LocationRange struct {
	ScriptID cdp.ScriptID    `json:"scriptId"`
	Start    *ScriptPosition `json:"start"`
	End      *ScriptPosition `json:"end"`
}

LocationRange location range within one script.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-LocationRange

type NextWasmDisassemblyChunkParams

type NextWasmDisassemblyChunkParams struct {
	StreamID string `json:"streamId"`
}

NextWasmDisassemblyChunkParams are the parameters of the command Debugger.nextWasmDisassemblyChunk.

type NextWasmDisassemblyChunkResult added in v0.157.3

type NextWasmDisassemblyChunkResult struct {
	Chunk *WasmDisassemblyChunk `json:"chunk,omitempty,omitzero"` // The next chunk of disassembly.
}

NextWasmDisassemblyChunkResult is the result of the command Debugger.nextWasmDisassemblyChunk.

type PausedReason added in v0.157.1

type PausedReason string

PausedReason pause reason.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#event-paused

const (
	PausedReasonAmbiguous        PausedReason = "ambiguous"
	PausedReasonAssert           PausedReason = "assert"
	PausedReasonCSPViolation     PausedReason = "CSPViolation"
	PausedReasonDebugCommand     PausedReason = "debugCommand"
	PausedReasonDOM              PausedReason = "DOM"
	PausedReasonEventListener    PausedReason = "EventListener"
	PausedReasonException        PausedReason = "exception"
	PausedReasonInstrumentation  PausedReason = "instrumentation"
	PausedReasonOOM              PausedReason = "OOM"
	PausedReasonOther            PausedReason = "other"
	PausedReasonPromiseRejection PausedReason = "promiseRejection"
	PausedReasonXHR              PausedReason = "XHR"
	PausedReasonStep             PausedReason = "step"
)

PausedReason values.

func (PausedReason) String added in v0.157.1

func (t PausedReason) String() string

String returns the PausedReason as string value.

type RemoveBreakpointParams

type RemoveBreakpointParams struct {
	BreakpointID BreakpointID `json:"breakpointId"`
}

RemoveBreakpointParams are the parameters of the command Debugger.removeBreakpoint.

type ResolvedBreakpoint

type ResolvedBreakpoint struct {
	BreakpointID BreakpointID `json:"breakpointId"` // Breakpoint unique identifier.
	Location     *Location    `json:"location"`     // Actual breakpoint location.
}

ResolvedBreakpoint [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-ResolvedBreakpoint

type RestartFrameMode added in v0.157.1

type RestartFrameMode string

RestartFrameMode the mode parameter must be present and set to 'StepInto', otherwise restartFrame will error out.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-restartFrame

const (
	RestartFrameModeStepInto RestartFrameMode = "StepInto"
)

RestartFrameMode values.

func (RestartFrameMode) String added in v0.157.1

func (t RestartFrameMode) String() string

String returns the RestartFrameMode as string value.

type RestartFrameParams

type RestartFrameParams struct {
	CallFrameID CallFrameID      `json:"callFrameId"`             // Call frame identifier to evaluate on.
	Mode        RestartFrameMode `json:"mode,omitempty,omitzero"` // The mode parameter must be present and set to 'StepInto', otherwise restartFrame will error out.
}

RestartFrameParams are the parameters of the command Debugger.restartFrame.

type ResumeParams

type ResumeParams struct {
	TerminateOnResume *bool `json:"terminateOnResume,omitempty,omitzero"` // 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.
}

ResumeParams are the parameters of the command Debugger.resume.

type Scope

type Scope struct {
	Type          ScopeType             `json:"type"`   // Scope type.
	Object        *runtime.RemoteObject `json:"object"` // Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
	Name          string                `json:"name,omitempty,omitzero"`
	StartLocation *Location             `json:"startLocation,omitempty,omitzero"` // Location in the source code where scope starts
	EndLocation   *Location             `json:"endLocation,omitempty,omitzero"`   // Location in the source code where scope ends
	EmptyReason   ScopeEmptyReason      `json:"emptyReason,omitempty,omitzero"`   // Present if the scope has no variable values to show. Absent means that the scope declares at least one variable with an available value. Empty scopes are retained in the scope chain because they can be targeted via evaluateOnCallFrame (using scopeNumber) or matched against scopes in source maps.
}

Scope scope description.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-Scope

type ScopeEmptyReason added in v0.157.1

type ScopeEmptyReason string

ScopeEmptyReason present if the scope has no variable values to show. Absent means that the scope declares at least one variable with an available value. Empty scopes are retained in the scope chain because they can be targeted via evaluateOnCallFrame (using scopeNumber) or matched against scopes in source maps.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-Scope

const (
	ScopeEmptyReasonNoVariables    ScopeEmptyReason = "no-variables"
	ScopeEmptyReasonAllUnavailable ScopeEmptyReason = "all-unavailable"
)

ScopeEmptyReason values.

func (ScopeEmptyReason) String added in v0.157.1

func (t ScopeEmptyReason) String() string

String returns the ScopeEmptyReason as string value.

type ScopeType added in v0.157.1

type ScopeType string

ScopeType scope type.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-Scope

const (
	ScopeTypeGlobal              ScopeType = "global"
	ScopeTypeLocal               ScopeType = "local"
	ScopeTypeWith                ScopeType = "with"
	ScopeTypeClosure             ScopeType = "closure"
	ScopeTypeCatch               ScopeType = "catch"
	ScopeTypeBlock               ScopeType = "block"
	ScopeTypeScript              ScopeType = "script"
	ScopeTypeEval                ScopeType = "eval"
	ScopeTypeModule              ScopeType = "module"
	ScopeTypeWasmExpressionStack ScopeType = "wasm-expression-stack"
)

ScopeType values.

func (ScopeType) String added in v0.157.1

func (t ScopeType) String() string

String returns the ScopeType as string value.

type ScriptLanguage

type ScriptLanguage string

ScriptLanguage enum of possible script languages.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-ScriptLanguage

const (
	ScriptLanguageJavaScript  ScriptLanguage = "JavaScript"
	ScriptLanguageWebAssembly ScriptLanguage = "WebAssembly"
)

ScriptLanguage values.

func (ScriptLanguage) String

func (t ScriptLanguage) String() string

String returns the ScriptLanguage as string value.

type ScriptPosition

type ScriptPosition struct {
	LineNumber   int64 `json:"lineNumber"`
	ColumnNumber int64 `json:"columnNumber"`
}

ScriptPosition location in the source code.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-ScriptPosition

type SearchInContentParams

type SearchInContentParams struct {
	ScriptID      cdp.ScriptID `json:"scriptId"`                         // Id of the script to search in.
	Query         string       `json:"query"`                            // String to search for.
	CaseSensitive *bool        `json:"caseSensitive,omitempty,omitzero"` // If true, search is case sensitive.
	IsRegex       *bool        `json:"isRegex,omitempty,omitzero"`       // If true, treats string parameter as regex.
}

SearchInContentParams are the parameters of the command Debugger.searchInContent.

type SearchInContentResult added in v0.157.3

type SearchInContentResult struct {
	Result []*SearchMatch `json:"result,omitempty,omitzero"` // List of search matches.
}

SearchInContentResult is the result of the command Debugger.searchInContent.

type SearchMatch

type SearchMatch struct {
	LineNumber  float64 `json:"lineNumber"`  // Line number in resource content.
	LineContent string  `json:"lineContent"` // Line with match content.
}

SearchMatch search match for resource.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-SearchMatch

type SetAsyncCallStackDepthParams

type SetAsyncCallStackDepthParams struct {
	MaxDepth int64 `json:"maxDepth"` // Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default).
}

SetAsyncCallStackDepthParams are the parameters of the command Debugger.setAsyncCallStackDepth.

type SetBlackboxExecutionContextsParams

type SetBlackboxExecutionContextsParams struct {
	UniqueIDs []string `json:"uniqueIds"` // Array of execution context unique ids for the debugger to ignore.
}

SetBlackboxExecutionContextsParams are the parameters of the command Debugger.setBlackboxExecutionContexts.

type SetBlackboxPatternsParams

type SetBlackboxPatternsParams struct {
	Patterns      []string `json:"patterns"`                         // Array of regexps that will be used to check script url for blackbox state.
	SkipAnonymous *bool    `json:"skipAnonymous,omitempty,omitzero"` // If true, also ignore scripts with no source url.
}

SetBlackboxPatternsParams are the parameters of the command Debugger.setBlackboxPatterns.

type SetBlackboxedRangesParams

type SetBlackboxedRangesParams struct {
	ScriptID  cdp.ScriptID      `json:"scriptId"` // Id of the script.
	Positions []*ScriptPosition `json:"positions"`
}

SetBlackboxedRangesParams are the parameters of the command Debugger.setBlackboxedRanges.

type SetBreakpointByURLParams

type SetBreakpointByURLParams struct {
	LineNumber   int64  `json:"lineNumber"`                      // Line number to set breakpoint at.
	URL          string `json:"url,omitempty,omitzero"`          // URL of the resources to set breakpoint on.
	URLRegex     string `json:"urlRegex,omitempty,omitzero"`     // Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified.
	ScriptHash   string `json:"scriptHash,omitempty,omitzero"`   // Script hash of the resources to set breakpoint on.
	ColumnNumber *int64 `json:"columnNumber,omitempty,omitzero"` // Offset in the line to set breakpoint at.
	Condition    string `json:"condition,omitempty,omitzero"`    // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
}

SetBreakpointByURLParams are the parameters of the command Debugger.setBreakpointByUrl.

type SetBreakpointByURLResult added in v0.157.3

type SetBreakpointByURLResult struct {
	BreakpointID BreakpointID `json:"breakpointId,omitempty,omitzero"` // Id of the created breakpoint for further reference.
	Locations    []*Location  `json:"locations,omitempty,omitzero"`    // List of the locations this breakpoint resolved into upon addition.
}

SetBreakpointByURLResult is the result of the command Debugger.setBreakpointByUrl.

type SetBreakpointOnFunctionCallParams

type SetBreakpointOnFunctionCallParams struct {
	ObjectID  runtime.RemoteObjectID `json:"objectId"`                     // Function object id.
	Condition string                 `json:"condition,omitempty,omitzero"` // Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
}

SetBreakpointOnFunctionCallParams are the parameters of the command Debugger.setBreakpointOnFunctionCall.

type SetBreakpointOnFunctionCallResult added in v0.157.3

type SetBreakpointOnFunctionCallResult struct {
	BreakpointID BreakpointID `json:"breakpointId,omitempty,omitzero"` // Id of the created breakpoint for further reference.
}

SetBreakpointOnFunctionCallResult is the result of the command Debugger.setBreakpointOnFunctionCall.

type SetBreakpointParams

type SetBreakpointParams struct {
	Location  *Location `json:"location"`                     // Location to set breakpoint in.
	Condition string    `json:"condition,omitempty,omitzero"` // Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
}

SetBreakpointParams are the parameters of the command Debugger.setBreakpoint.

type SetBreakpointResult added in v0.157.3

type SetBreakpointResult struct {
	BreakpointID   BreakpointID `json:"breakpointId,omitempty,omitzero"`   // Id of the created breakpoint for further reference.
	ActualLocation *Location    `json:"actualLocation,omitempty,omitzero"` // Location this breakpoint resolved into.
}

SetBreakpointResult is the result of the command Debugger.setBreakpoint.

type SetBreakpointsActiveParams

type SetBreakpointsActiveParams struct {
	Active bool `json:"active"` // New value for breakpoints active state.
}

SetBreakpointsActiveParams are the parameters of the command Debugger.setBreakpointsActive.

type SetInstrumentationBreakpointInstrumentation added in v0.157.1

type SetInstrumentationBreakpointInstrumentation string

SetInstrumentationBreakpointInstrumentation instrumentation name.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setInstrumentationBreakpoint

const (
	SetInstrumentationBreakpointInstrumentationBeforeScriptExecution              SetInstrumentationBreakpointInstrumentation = "beforeScriptExecution"
	SetInstrumentationBreakpointInstrumentationBeforeScriptWithSourceMapExecution SetInstrumentationBreakpointInstrumentation = "beforeScriptWithSourceMapExecution"
)

SetInstrumentationBreakpointInstrumentation values.

func (SetInstrumentationBreakpointInstrumentation) String added in v0.157.1

String returns the SetInstrumentationBreakpointInstrumentation as string value.

type SetInstrumentationBreakpointParams

type SetInstrumentationBreakpointParams struct {
	Instrumentation SetInstrumentationBreakpointInstrumentation `json:"instrumentation"` // Instrumentation name.
}

SetInstrumentationBreakpointParams are the parameters of the command Debugger.setInstrumentationBreakpoint.

type SetInstrumentationBreakpointResult added in v0.157.3

type SetInstrumentationBreakpointResult struct {
	BreakpointID BreakpointID `json:"breakpointId,omitempty,omitzero"` // Id of the created breakpoint for further reference.
}

SetInstrumentationBreakpointResult is the result of the command Debugger.setInstrumentationBreakpoint.

type SetPauseOnExceptionsParams

type SetPauseOnExceptionsParams struct {
	State SetPauseOnExceptionsState `json:"state"` // Pause on exceptions mode.
}

SetPauseOnExceptionsParams are the parameters of the command Debugger.setPauseOnExceptions.

type SetPauseOnExceptionsState added in v0.157.1

type SetPauseOnExceptionsState string

SetPauseOnExceptionsState pause on exceptions mode.

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#method-setPauseOnExceptions

const (
	SetPauseOnExceptionsStateNone     SetPauseOnExceptionsState = "none"
	SetPauseOnExceptionsStateCaught   SetPauseOnExceptionsState = "caught"
	SetPauseOnExceptionsStateUncaught SetPauseOnExceptionsState = "uncaught"
	SetPauseOnExceptionsStateAll      SetPauseOnExceptionsState = "all"
)

SetPauseOnExceptionsState values.

func (SetPauseOnExceptionsState) String added in v0.157.1

func (t SetPauseOnExceptionsState) String() string

String returns the SetPauseOnExceptionsState as string value.

type SetReturnValueParams

type SetReturnValueParams struct {
	NewValue *runtime.CallArgument `json:"newValue"` // New return value.
}

SetReturnValueParams are the parameters of the command Debugger.setReturnValue.

type SetSkipAllPausesParams

type SetSkipAllPausesParams struct {
	Skip bool `json:"skip"` // New value for skip pauses state.
}

SetSkipAllPausesParams are the parameters of the command Debugger.setSkipAllPauses.

type SetVariableValueParams

type SetVariableValueParams struct {
	ScopeNumber  int64                 `json:"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 string                `json:"variableName"` // Variable name.
	NewValue     *runtime.CallArgument `json:"newValue"`     // New variable value.
	CallFrameID  CallFrameID           `json:"callFrameId"`  // Id of callframe that holds variable.
}

SetVariableValueParams are the parameters of the command Debugger.setVariableValue.

type StepIntoParams

type StepIntoParams struct {
	BreakOnAsyncCall *bool            `json:"breakOnAsyncCall,omitempty,omitzero"` // Debugger will pause on the execution of the first async task which was scheduled before next pause.
	SkipList         []*LocationRange `json:"skipList,omitempty,omitzero"`         // The skipList specifies location ranges that should be skipped on step into.
}

StepIntoParams are the parameters of the command Debugger.stepInto.

type StepOverParams

type StepOverParams struct {
	SkipList    []*LocationRange `json:"skipList,omitempty,omitzero"`    // The skipList specifies location ranges that should be skipped on step over.
	EnterRanges []*LocationRange `json:"enterRanges,omitempty,omitzero"` // Functions whose source range lies within one of the enterRanges are entered as if by stepInto, even when they are called (directly or indirectly) from a call that is stepped over.
}

StepOverParams are the parameters of the command Debugger.stepOver.

type WasmDisassemblyChunk

type WasmDisassemblyChunk struct {
	Lines           []string `json:"lines"`           // The next chunk of disassembled lines.
	BytecodeOffsets []int64  `json:"bytecodeOffsets"` // The bytecode offsets describing the start of each line.
}

WasmDisassemblyChunk [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/Debugger#type-WasmDisassemblyChunk

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL