Skip to main content

cdp_driver/methods/
debugger.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Debugger domain exposes JavaScript debugging capabilities. It allows
5//! setting and removing breakpoints, stepping through execution, exploring
6//! stack traces, etc.
7//!
8//! Method names for the `Debugger` domain, for use with
9//! [`CdpClient::call`](crate::CdpClient::call).
10
11/// Continues execution until specific location is reached.
12///
13/// Parameters:
14/// - `location`: Location
15/// - `targetCallFrames`: string (optional)
16pub const CONTINUE_TO_LOCATION: &str = "Debugger.continueToLocation";
17
18/// Disables debugger for given page.
19pub const DISABLE: &str = "Debugger.disable";
20
21/// Enables debugger for the given page. Clients should not assume that the
22/// debugging has been enabled until the result for this command is received.
23///
24/// Parameters:
25/// - `maxScriptsCacheSize`: number (optional)
26///
27/// Returns: `debuggerId`
28pub const ENABLE: &str = "Debugger.enable";
29
30/// Evaluates expression on a given call frame.
31///
32/// Parameters:
33/// - `callFrameId`: CallFrameId
34/// - `expression`: string
35/// - `objectGroup`: string (optional)
36/// - `includeCommandLineAPI`: boolean (optional)
37/// - `silent`: boolean (optional)
38/// - `returnByValue`: boolean (optional)
39/// - `generatePreview`: boolean (optional)
40/// - `throwOnSideEffect`: boolean (optional)
41/// - `timeout`: Runtime.TimeDelta (optional)
42/// - `scopeNumber`: integer (optional)
43///
44/// Returns: `result`, `exceptionDetails`
45pub const EVALUATE_ON_CALL_FRAME: &str = "Debugger.evaluateOnCallFrame";
46
47/// Returns possible locations for breakpoint. scriptId in start and end range
48/// locations should be the same.
49///
50/// Parameters:
51/// - `start`: Location
52/// - `end`: Location (optional)
53/// - `restrictToFunction`: boolean (optional)
54///
55/// Returns: `locations`
56pub const GET_POSSIBLE_BREAKPOINTS: &str = "Debugger.getPossibleBreakpoints";
57
58/// Returns source for the script with given id.
59///
60/// Parameters:
61/// - `scriptId`: Runtime.ScriptId
62///
63/// Returns: `scriptSource`, `bytecode`
64pub const GET_SCRIPT_SOURCE: &str = "Debugger.getScriptSource";
65
66/// `Debugger.disassembleWasmModule`
67///
68/// Experimental: may change without notice.
69///
70/// Parameters:
71/// - `scriptId`: Runtime.ScriptId
72///
73/// Returns: `streamId`, `totalNumberOfLines`, `functionBodyOffsets`, `chunk`
74pub const DISASSEMBLE_WASM_MODULE: &str = "Debugger.disassembleWasmModule";
75
76/// Disassemble the next chunk of lines for the module corresponding to the
77/// stream. If disassembly is complete, this API will invalidate the streamId
78/// and return an empty chunk. Any subsequent calls for the now invalid stream
79/// will return errors.
80///
81/// Experimental: may change without notice.
82///
83/// Parameters:
84/// - `streamId`: string
85///
86/// Returns: `chunk`
87pub const NEXT_WASM_DISASSEMBLY_CHUNK: &str = "Debugger.nextWasmDisassemblyChunk";
88
89/// This command is deprecated. Use getScriptSource instead.
90///
91/// Deprecated in the protocol.
92///
93/// Parameters:
94/// - `scriptId`: Runtime.ScriptId
95///
96/// Returns: `bytecode`
97pub const GET_WASM_BYTECODE: &str = "Debugger.getWasmBytecode";
98
99/// Returns stack trace with given `stackTraceId`.
100///
101/// Experimental: may change without notice.
102///
103/// Parameters:
104/// - `stackTraceId`: Runtime.StackTraceId
105///
106/// Returns: `stackTrace`
107pub const GET_STACK_TRACE: &str = "Debugger.getStackTrace";
108
109/// Stops on the next JavaScript statement.
110pub const PAUSE: &str = "Debugger.pause";
111
112/// `Debugger.pauseOnAsyncCall`
113///
114/// Deprecated in the protocol.
115/// Experimental: may change without notice.
116///
117/// Parameters:
118/// - `parentStackTraceId`: Runtime.StackTraceId
119pub const PAUSE_ON_ASYNC_CALL: &str = "Debugger.pauseOnAsyncCall";
120
121/// Removes JavaScript breakpoint.
122///
123/// Parameters:
124/// - `breakpointId`: BreakpointId
125pub const REMOVE_BREAKPOINT: &str = "Debugger.removeBreakpoint";
126
127/// Restarts particular call frame from the beginning. The old, deprecated
128/// behavior of `restartFrame` is to stay paused and allow further CDP
129/// commands after a restart was scheduled. This can cause problems with
130/// restarting, so we now continue execution immediatly after it has been
131/// scheduled until we reach the beginning of the restarted frame. To stay
132/// back-wards compatible, `restartFrame` now expects a `mode` parameter to be
133/// present. If the `mode` parameter is missing, `restartFrame` errors out.
134/// The various return values are deprecated and `callFrames` is always empty.
135/// Use the call frames from the `Debugger#paused` events instead, that fires
136/// once V8 pauses at the beginning of the restarted function.
137///
138/// Parameters:
139/// - `callFrameId`: CallFrameId
140/// - `mode`: string (optional)
141///
142/// Returns: `callFrames`, `asyncStackTrace`, `asyncStackTraceId`
143pub const RESTART_FRAME: &str = "Debugger.restartFrame";
144
145/// Resumes JavaScript execution.
146///
147/// Parameters:
148/// - `terminateOnResume`: boolean (optional)
149pub const RESUME: &str = "Debugger.resume";
150
151/// Searches for given string in script content.
152///
153/// Parameters:
154/// - `scriptId`: Runtime.ScriptId
155/// - `query`: string
156/// - `caseSensitive`: boolean (optional)
157/// - `isRegex`: boolean (optional)
158///
159/// Returns: `result`
160pub const SEARCH_IN_CONTENT: &str = "Debugger.searchInContent";
161
162/// Enables or disables async call stacks tracking.
163///
164/// Parameters:
165/// - `maxDepth`: integer
166pub const SET_ASYNC_CALL_STACK_DEPTH: &str = "Debugger.setAsyncCallStackDepth";
167
168/// Replace previous blackbox execution contexts with passed ones. Forces
169/// backend to skip stepping/pausing in scripts in these execution contexts.
170/// VM will try to leave blackboxed script by performing 'step in' several
171/// times, finally resorting to 'step out' if unsuccessful.
172///
173/// Experimental: may change without notice.
174///
175/// Parameters:
176/// - `uniqueIds`: array
177pub const SET_BLACKBOX_EXECUTION_CONTEXTS: &str = "Debugger.setBlackboxExecutionContexts";
178
179/// Replace previous blackbox patterns with passed ones. Forces backend to
180/// skip stepping/pausing in scripts with url matching one of the patterns. VM
181/// will try to leave blackboxed script by performing 'step in' several times,
182/// finally resorting to 'step out' if unsuccessful.
183///
184/// Experimental: may change without notice.
185///
186/// Parameters:
187/// - `patterns`: array
188/// - `skipAnonymous`: boolean (optional)
189pub const SET_BLACKBOX_PATTERNS: &str = "Debugger.setBlackboxPatterns";
190
191/// Makes backend skip steps in the script in blackboxed ranges. VM will try
192/// leave blacklisted scripts by performing 'step in' several times, finally
193/// resorting to 'step out' if unsuccessful. Positions array contains
194/// positions where blackbox state is changed. First interval isn't
195/// blackboxed. Array should be sorted.
196///
197/// Experimental: may change without notice.
198///
199/// Parameters:
200/// - `scriptId`: Runtime.ScriptId
201/// - `positions`: array
202pub const SET_BLACKBOXED_RANGES: &str = "Debugger.setBlackboxedRanges";
203
204/// Sets JavaScript breakpoint at a given location.
205///
206/// Parameters:
207/// - `location`: Location
208/// - `condition`: string (optional)
209///
210/// Returns: `breakpointId`, `actualLocation`
211pub const SET_BREAKPOINT: &str = "Debugger.setBreakpoint";
212
213/// Sets instrumentation breakpoint.
214///
215/// Parameters:
216/// - `instrumentation`: string
217///
218/// Returns: `breakpointId`
219pub const SET_INSTRUMENTATION_BREAKPOINT: &str = "Debugger.setInstrumentationBreakpoint";
220
221/// Sets JavaScript breakpoint at given location specified either by URL or
222/// URL regex. Once this command is issued, all existing parsed scripts will
223/// have breakpoints resolved and returned in `locations` property. Further
224/// matching script parsing will result in subsequent `breakpointResolved`
225/// events issued. This logical breakpoint will survive page reloads.
226///
227/// Parameters:
228/// - `lineNumber`: integer
229/// - `url`: string (optional)
230/// - `urlRegex`: string (optional)
231/// - `scriptHash`: string (optional)
232/// - `columnNumber`: integer (optional)
233/// - `condition`: string (optional)
234///
235/// Returns: `breakpointId`, `locations`
236pub const SET_BREAKPOINT_BY_URL: &str = "Debugger.setBreakpointByUrl";
237
238/// Sets JavaScript breakpoint before each call to the given function. If
239/// another function was created from the same source as a given one, calling
240/// it will also trigger the breakpoint.
241///
242/// Experimental: may change without notice.
243///
244/// Parameters:
245/// - `objectId`: Runtime.RemoteObjectId
246/// - `condition`: string (optional)
247///
248/// Returns: `breakpointId`
249pub const SET_BREAKPOINT_ON_FUNCTION_CALL: &str = "Debugger.setBreakpointOnFunctionCall";
250
251/// Activates / deactivates all breakpoints on the page.
252///
253/// Parameters:
254/// - `active`: boolean
255pub const SET_BREAKPOINTS_ACTIVE: &str = "Debugger.setBreakpointsActive";
256
257/// Defines pause on exceptions state. Can be set to stop on all exceptions,
258/// uncaught exceptions, or caught exceptions, no exceptions. Initial pause on
259/// exceptions state is `none`.
260///
261/// Parameters:
262/// - `state`: string
263pub const SET_PAUSE_ON_EXCEPTIONS: &str = "Debugger.setPauseOnExceptions";
264
265/// Changes return value in top frame. Available only at return break
266/// position.
267///
268/// Experimental: may change without notice.
269///
270/// Parameters:
271/// - `newValue`: Runtime.CallArgument
272pub const SET_RETURN_VALUE: &str = "Debugger.setReturnValue";
273
274/// Edits JavaScript source live. In general, functions that are currently on
275/// the stack can not be edited with a single exception: If the edited
276/// function is the top-most stack frame and that is the only activation of
277/// that function on the stack. In this case the live edit will be successful
278/// and a `Debugger.restartFrame` for the top-most function is automatically
279/// triggered.
280///
281/// Parameters:
282/// - `scriptId`: Runtime.ScriptId
283/// - `scriptSource`: string
284/// - `dryRun`: boolean (optional)
285/// - `allowTopFrameEditing`: boolean (optional)
286///
287/// Returns: `callFrames`, `stackChanged`, `asyncStackTrace`, `asyncStackTraceId`, `status`, `exceptionDetails`
288pub const SET_SCRIPT_SOURCE: &str = "Debugger.setScriptSource";
289
290/// Makes page not interrupt on any pauses (breakpoint, exception, dom
291/// exception etc).
292///
293/// Parameters:
294/// - `skip`: boolean
295pub const SET_SKIP_ALL_PAUSES: &str = "Debugger.setSkipAllPauses";
296
297/// Changes value of variable in a callframe. Object-based scopes are not
298/// supported and must be mutated manually.
299///
300/// Parameters:
301/// - `scopeNumber`: integer
302/// - `variableName`: string
303/// - `newValue`: Runtime.CallArgument
304/// - `callFrameId`: CallFrameId
305pub const SET_VARIABLE_VALUE: &str = "Debugger.setVariableValue";
306
307/// Steps into the function call.
308///
309/// Parameters:
310/// - `breakOnAsyncCall`: boolean (optional)
311/// - `skipList`: array (optional)
312pub const STEP_INTO: &str = "Debugger.stepInto";
313
314/// Steps out of the function call.
315pub const STEP_OUT: &str = "Debugger.stepOut";
316
317/// Steps over the statement.
318///
319/// Parameters:
320/// - `skipList`: array (optional)
321pub const STEP_OVER: &str = "Debugger.stepOver";