forked from go-rod/rod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debugger.go
1311 lines (954 loc) · 45.6 KB
/
debugger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is generated by "./lib/proto/generate"
package proto
import (
"github.com/ysmood/gson"
)
/*
Debugger
Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
breakpoints, stepping through execution, exploring stack traces, etc.
*/
// DebuggerBreakpointID Breakpoint identifier.
type DebuggerBreakpointID string
// DebuggerCallFrameID Call frame identifier.
type DebuggerCallFrameID string
// DebuggerLocation Location in the source code.
type DebuggerLocation struct {
// ScriptID Script identifier as reported in the `Debugger.scriptParsed`.
ScriptID RuntimeScriptID `json:"scriptId"`
// LineNumber Line number in the script (0-based).
LineNumber int `json:"lineNumber"`
// ColumnNumber (optional) Column number in the script (0-based).
ColumnNumber *int `json:"columnNumber,omitempty"`
}
// DebuggerScriptPosition (experimental) Location in the source code.
type DebuggerScriptPosition struct {
// LineNumber ...
LineNumber int `json:"lineNumber"`
// ColumnNumber ...
ColumnNumber int `json:"columnNumber"`
}
// DebuggerLocationRange (experimental) Location range within one script.
type DebuggerLocationRange struct {
// ScriptID ...
ScriptID RuntimeScriptID `json:"scriptId"`
// Start ...
Start *DebuggerScriptPosition `json:"start"`
// End ...
End *DebuggerScriptPosition `json:"end"`
}
// DebuggerCallFrame JavaScript call frame. Array of call frames form the call stack.
type DebuggerCallFrame struct {
// CallFrameID Call frame identifier. This identifier is only valid while the virtual machine is paused.
CallFrameID DebuggerCallFrameID `json:"callFrameId"`
// FunctionName Name of the JavaScript function called on this call frame.
FunctionName string `json:"functionName"`
// FunctionLocation (optional) Location in the source code.
FunctionLocation *DebuggerLocation `json:"functionLocation,omitempty"`
// Location Location in the source code.
Location *DebuggerLocation `json:"location"`
// URL (deprecated) JavaScript script name or url.
// Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously
// sent `Debugger.scriptParsed` event.
URL string `json:"url"`
// ScopeChain Scope chain for this call frame.
ScopeChain []*DebuggerScope `json:"scopeChain"`
// This `this` object for this call frame.
This *RuntimeRemoteObject `json:"this"`
// ReturnValue (optional) The value being returned, if the function is at return point.
ReturnValue *RuntimeRemoteObject `json:"returnValue,omitempty"`
// CanBeRestarted (experimental) (optional) 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.
CanBeRestarted bool `json:"canBeRestarted,omitempty"`
}
// DebuggerScopeType enum
type DebuggerScopeType string
const (
// DebuggerScopeTypeGlobal enum const
DebuggerScopeTypeGlobal DebuggerScopeType = "global"
// DebuggerScopeTypeLocal enum const
DebuggerScopeTypeLocal DebuggerScopeType = "local"
// DebuggerScopeTypeWith enum const
DebuggerScopeTypeWith DebuggerScopeType = "with"
// DebuggerScopeTypeClosure enum const
DebuggerScopeTypeClosure DebuggerScopeType = "closure"
// DebuggerScopeTypeCatch enum const
DebuggerScopeTypeCatch DebuggerScopeType = "catch"
// DebuggerScopeTypeBlock enum const
DebuggerScopeTypeBlock DebuggerScopeType = "block"
// DebuggerScopeTypeScript enum const
DebuggerScopeTypeScript DebuggerScopeType = "script"
// DebuggerScopeTypeEval enum const
DebuggerScopeTypeEval DebuggerScopeType = "eval"
// DebuggerScopeTypeModule enum const
DebuggerScopeTypeModule DebuggerScopeType = "module"
// DebuggerScopeTypeWasmExpressionStack enum const
DebuggerScopeTypeWasmExpressionStack DebuggerScopeType = "wasm-expression-stack"
)
// DebuggerScope Scope description.
type DebuggerScope struct {
// Type Scope type.
Type DebuggerScopeType `json:"type"`
// 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.
Object *RuntimeRemoteObject `json:"object"`
// Name (optional) ...
Name string `json:"name,omitempty"`
// StartLocation (optional) Location in the source code where scope starts
StartLocation *DebuggerLocation `json:"startLocation,omitempty"`
// EndLocation (optional) Location in the source code where scope ends
EndLocation *DebuggerLocation `json:"endLocation,omitempty"`
}
// DebuggerSearchMatch Search match for resource.
type DebuggerSearchMatch struct {
// LineNumber Line number in resource content.
LineNumber float64 `json:"lineNumber"`
// LineContent Line with match content.
LineContent string `json:"lineContent"`
}
// DebuggerBreakLocationType enum
type DebuggerBreakLocationType string
const (
// DebuggerBreakLocationTypeDebuggerStatement enum const
DebuggerBreakLocationTypeDebuggerStatement DebuggerBreakLocationType = "debuggerStatement"
// DebuggerBreakLocationTypeCall enum const
DebuggerBreakLocationTypeCall DebuggerBreakLocationType = "call"
// DebuggerBreakLocationTypeReturn enum const
DebuggerBreakLocationTypeReturn DebuggerBreakLocationType = "return"
)
// DebuggerBreakLocation ...
type DebuggerBreakLocation struct {
// ScriptID Script identifier as reported in the `Debugger.scriptParsed`.
ScriptID RuntimeScriptID `json:"scriptId"`
// LineNumber Line number in the script (0-based).
LineNumber int `json:"lineNumber"`
// ColumnNumber (optional) Column number in the script (0-based).
ColumnNumber *int `json:"columnNumber,omitempty"`
// Type (optional) ...
Type DebuggerBreakLocationType `json:"type,omitempty"`
}
// DebuggerWasmDisassemblyChunk (experimental) ...
type DebuggerWasmDisassemblyChunk struct {
// Lines The next chunk of disassembled lines.
Lines []string `json:"lines"`
// BytecodeOffsets The bytecode offsets describing the start of each line.
BytecodeOffsets []int `json:"bytecodeOffsets"`
}
// DebuggerScriptLanguage Enum of possible script languages.
type DebuggerScriptLanguage string
const (
// DebuggerScriptLanguageJavaScript enum const
DebuggerScriptLanguageJavaScript DebuggerScriptLanguage = "JavaScript"
// DebuggerScriptLanguageWebAssembly enum const
DebuggerScriptLanguageWebAssembly DebuggerScriptLanguage = "WebAssembly"
)
// DebuggerDebugSymbolsType enum
type DebuggerDebugSymbolsType string
const (
// DebuggerDebugSymbolsTypeNone enum const
DebuggerDebugSymbolsTypeNone DebuggerDebugSymbolsType = "None"
// DebuggerDebugSymbolsTypeSourceMap enum const
DebuggerDebugSymbolsTypeSourceMap DebuggerDebugSymbolsType = "SourceMap"
// DebuggerDebugSymbolsTypeEmbeddedDWARF enum const
DebuggerDebugSymbolsTypeEmbeddedDWARF DebuggerDebugSymbolsType = "EmbeddedDWARF"
// DebuggerDebugSymbolsTypeExternalDWARF enum const
DebuggerDebugSymbolsTypeExternalDWARF DebuggerDebugSymbolsType = "ExternalDWARF"
)
// DebuggerDebugSymbols Debug symbols available for a wasm script.
type DebuggerDebugSymbols struct {
// Type Type of the debug symbols.
Type DebuggerDebugSymbolsType `json:"type"`
// ExternalURL (optional) URL of the external symbol source.
ExternalURL string `json:"externalURL,omitempty"`
}
// DebuggerContinueToLocationTargetCallFrames enum
type DebuggerContinueToLocationTargetCallFrames string
const (
// DebuggerContinueToLocationTargetCallFramesAny enum const
DebuggerContinueToLocationTargetCallFramesAny DebuggerContinueToLocationTargetCallFrames = "any"
// DebuggerContinueToLocationTargetCallFramesCurrent enum const
DebuggerContinueToLocationTargetCallFramesCurrent DebuggerContinueToLocationTargetCallFrames = "current"
)
// DebuggerContinueToLocation Continues execution until specific location is reached.
type DebuggerContinueToLocation struct {
// Location Location to continue to.
Location *DebuggerLocation `json:"location"`
// TargetCallFrames (optional) ...
TargetCallFrames DebuggerContinueToLocationTargetCallFrames `json:"targetCallFrames,omitempty"`
}
// ProtoReq name
func (m DebuggerContinueToLocation) ProtoReq() string { return "Debugger.continueToLocation" }
// Call sends the request
func (m DebuggerContinueToLocation) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerDisable Disables debugger for given page.
type DebuggerDisable struct {
}
// ProtoReq name
func (m DebuggerDisable) ProtoReq() string { return "Debugger.disable" }
// Call sends the request
func (m DebuggerDisable) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerEnable Enables debugger for the given page. Clients should not assume that the debugging has been
// enabled until the result for this command is received.
type DebuggerEnable struct {
// MaxScriptsCacheSize (experimental) (optional) 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.
MaxScriptsCacheSize *float64 `json:"maxScriptsCacheSize,omitempty"`
}
// ProtoReq name
func (m DebuggerEnable) ProtoReq() string { return "Debugger.enable" }
// Call the request
func (m DebuggerEnable) Call(c Client) (*DebuggerEnableResult, error) {
var res DebuggerEnableResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerEnableResult ...
type DebuggerEnableResult struct {
// DebuggerID (experimental) Unique identifier of the debugger.
DebuggerID RuntimeUniqueDebuggerID `json:"debuggerId"`
}
// DebuggerEvaluateOnCallFrame Evaluates expression on a given call frame.
type DebuggerEvaluateOnCallFrame struct {
// CallFrameID Call frame identifier to evaluate on.
CallFrameID DebuggerCallFrameID `json:"callFrameId"`
// Expression Expression to evaluate.
Expression string `json:"expression"`
// ObjectGroup (optional) String object group name to put result into (allows rapid releasing resulting object handles
// using `releaseObjectGroup`).
ObjectGroup string `json:"objectGroup,omitempty"`
// IncludeCommandLineAPI (optional) Specifies whether command line API should be available to the evaluated expression, defaults
// to false.
IncludeCommandLineAPI bool `json:"includeCommandLineAPI,omitempty"`
// Silent (optional) In silent mode exceptions thrown during evaluation are not reported and do not pause
// execution. Overrides `setPauseOnException` state.
Silent bool `json:"silent,omitempty"`
// ReturnByValue (optional) Whether the result is expected to be a JSON object that should be sent by value.
ReturnByValue bool `json:"returnByValue,omitempty"`
// GeneratePreview (experimental) (optional) Whether preview should be generated for the result.
GeneratePreview bool `json:"generatePreview,omitempty"`
// ThrowOnSideEffect (optional) Whether to throw an exception if side effect cannot be ruled out during evaluation.
ThrowOnSideEffect bool `json:"throwOnSideEffect,omitempty"`
// Timeout (experimental) (optional) Terminate execution after timing out (number of milliseconds).
Timeout RuntimeTimeDelta `json:"timeout,omitempty"`
}
// ProtoReq name
func (m DebuggerEvaluateOnCallFrame) ProtoReq() string { return "Debugger.evaluateOnCallFrame" }
// Call the request
func (m DebuggerEvaluateOnCallFrame) Call(c Client) (*DebuggerEvaluateOnCallFrameResult, error) {
var res DebuggerEvaluateOnCallFrameResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerEvaluateOnCallFrameResult ...
type DebuggerEvaluateOnCallFrameResult struct {
// Result Object wrapper for the evaluation result.
Result *RuntimeRemoteObject `json:"result"`
// ExceptionDetails (optional) Exception details.
ExceptionDetails *RuntimeExceptionDetails `json:"exceptionDetails,omitempty"`
}
// DebuggerGetPossibleBreakpoints Returns possible locations for breakpoint. scriptId in start and end range locations should be
// the same.
type DebuggerGetPossibleBreakpoints struct {
// Start Start of range to search possible breakpoint locations in.
Start *DebuggerLocation `json:"start"`
// End (optional) End of range to search possible breakpoint locations in (excluding). When not specified, end
// of scripts is used as end of range.
End *DebuggerLocation `json:"end,omitempty"`
// RestrictToFunction (optional) Only consider locations which are in the same (non-nested) function as start.
RestrictToFunction bool `json:"restrictToFunction,omitempty"`
}
// ProtoReq name
func (m DebuggerGetPossibleBreakpoints) ProtoReq() string { return "Debugger.getPossibleBreakpoints" }
// Call the request
func (m DebuggerGetPossibleBreakpoints) Call(c Client) (*DebuggerGetPossibleBreakpointsResult, error) {
var res DebuggerGetPossibleBreakpointsResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerGetPossibleBreakpointsResult ...
type DebuggerGetPossibleBreakpointsResult struct {
// Locations List of the possible breakpoint locations.
Locations []*DebuggerBreakLocation `json:"locations"`
}
// DebuggerGetScriptSource Returns source for the script with given id.
type DebuggerGetScriptSource struct {
// ScriptID Id of the script to get source for.
ScriptID RuntimeScriptID `json:"scriptId"`
}
// ProtoReq name
func (m DebuggerGetScriptSource) ProtoReq() string { return "Debugger.getScriptSource" }
// Call the request
func (m DebuggerGetScriptSource) Call(c Client) (*DebuggerGetScriptSourceResult, error) {
var res DebuggerGetScriptSourceResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerGetScriptSourceResult ...
type DebuggerGetScriptSourceResult struct {
// ScriptSource Script source (empty in case of Wasm bytecode).
ScriptSource string `json:"scriptSource"`
// Bytecode (optional) Wasm bytecode.
Bytecode []byte `json:"bytecode,omitempty"`
}
// DebuggerDisassembleWasmModule (experimental) ...
type DebuggerDisassembleWasmModule struct {
// ScriptID Id of the script to disassemble
ScriptID RuntimeScriptID `json:"scriptId"`
}
// ProtoReq name
func (m DebuggerDisassembleWasmModule) ProtoReq() string { return "Debugger.disassembleWasmModule" }
// Call the request
func (m DebuggerDisassembleWasmModule) Call(c Client) (*DebuggerDisassembleWasmModuleResult, error) {
var res DebuggerDisassembleWasmModuleResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerDisassembleWasmModuleResult (experimental) ...
type DebuggerDisassembleWasmModuleResult struct {
// StreamID (optional) For large modules, return a stream from which additional chunks of
// disassembly can be read successively.
StreamID string `json:"streamId,omitempty"`
// TotalNumberOfLines The total number of lines in the disassembly text.
TotalNumberOfLines int `json:"totalNumberOfLines"`
// FunctionBodyOffsets The offsets of all function bodies, in the format [start1, end1,
// start2, end2, ...] where all ends are exclusive.
FunctionBodyOffsets []int `json:"functionBodyOffsets"`
// Chunk The first chunk of disassembly.
Chunk *DebuggerWasmDisassemblyChunk `json:"chunk"`
}
// DebuggerNextWasmDisassemblyChunk (experimental) 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.
type DebuggerNextWasmDisassemblyChunk struct {
// StreamID ...
StreamID string `json:"streamId"`
}
// ProtoReq name
func (m DebuggerNextWasmDisassemblyChunk) ProtoReq() string {
return "Debugger.nextWasmDisassemblyChunk"
}
// Call the request
func (m DebuggerNextWasmDisassemblyChunk) Call(c Client) (*DebuggerNextWasmDisassemblyChunkResult, error) {
var res DebuggerNextWasmDisassemblyChunkResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerNextWasmDisassemblyChunkResult (experimental) ...
type DebuggerNextWasmDisassemblyChunkResult struct {
// Chunk The next chunk of disassembly.
Chunk *DebuggerWasmDisassemblyChunk `json:"chunk"`
}
// DebuggerGetWasmBytecode (deprecated) This command is deprecated. Use getScriptSource instead.
type DebuggerGetWasmBytecode struct {
// ScriptID Id of the Wasm script to get source for.
ScriptID RuntimeScriptID `json:"scriptId"`
}
// ProtoReq name
func (m DebuggerGetWasmBytecode) ProtoReq() string { return "Debugger.getWasmBytecode" }
// Call the request
func (m DebuggerGetWasmBytecode) Call(c Client) (*DebuggerGetWasmBytecodeResult, error) {
var res DebuggerGetWasmBytecodeResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerGetWasmBytecodeResult (deprecated) ...
type DebuggerGetWasmBytecodeResult struct {
// Bytecode Script source.
Bytecode []byte `json:"bytecode"`
}
// DebuggerGetStackTrace (experimental) Returns stack trace with given `stackTraceId`.
type DebuggerGetStackTrace struct {
// StackTraceID ...
StackTraceID *RuntimeStackTraceID `json:"stackTraceId"`
}
// ProtoReq name
func (m DebuggerGetStackTrace) ProtoReq() string { return "Debugger.getStackTrace" }
// Call the request
func (m DebuggerGetStackTrace) Call(c Client) (*DebuggerGetStackTraceResult, error) {
var res DebuggerGetStackTraceResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerGetStackTraceResult (experimental) ...
type DebuggerGetStackTraceResult struct {
// StackTrace ...
StackTrace *RuntimeStackTrace `json:"stackTrace"`
}
// DebuggerPause Stops on the next JavaScript statement.
type DebuggerPause struct {
}
// ProtoReq name
func (m DebuggerPause) ProtoReq() string { return "Debugger.pause" }
// Call sends the request
func (m DebuggerPause) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerPauseOnAsyncCall (deprecated) (experimental) ...
type DebuggerPauseOnAsyncCall struct {
// ParentStackTraceID Debugger will pause when async call with given stack trace is started.
ParentStackTraceID *RuntimeStackTraceID `json:"parentStackTraceId"`
}
// ProtoReq name
func (m DebuggerPauseOnAsyncCall) ProtoReq() string { return "Debugger.pauseOnAsyncCall" }
// Call sends the request
func (m DebuggerPauseOnAsyncCall) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerRemoveBreakpoint Removes JavaScript breakpoint.
type DebuggerRemoveBreakpoint struct {
// BreakpointID ...
BreakpointID DebuggerBreakpointID `json:"breakpointId"`
}
// ProtoReq name
func (m DebuggerRemoveBreakpoint) ProtoReq() string { return "Debugger.removeBreakpoint" }
// Call sends the request
func (m DebuggerRemoveBreakpoint) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerRestartFrameMode enum
type DebuggerRestartFrameMode string
const (
// DebuggerRestartFrameModeStepInto enum const
DebuggerRestartFrameModeStepInto DebuggerRestartFrameMode = "StepInto"
)
// DebuggerRestartFrame 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.
type DebuggerRestartFrame struct {
// CallFrameID Call frame identifier to evaluate on.
CallFrameID DebuggerCallFrameID `json:"callFrameId"`
// Mode (experimental) (optional) The `mode` parameter must be present and set to 'StepInto', otherwise
// `restartFrame` will error out.
Mode DebuggerRestartFrameMode `json:"mode,omitempty"`
}
// ProtoReq name
func (m DebuggerRestartFrame) ProtoReq() string { return "Debugger.restartFrame" }
// Call the request
func (m DebuggerRestartFrame) Call(c Client) (*DebuggerRestartFrameResult, error) {
var res DebuggerRestartFrameResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerRestartFrameResult ...
type DebuggerRestartFrameResult struct {
// CallFrames (deprecated) New stack trace.
CallFrames []*DebuggerCallFrame `json:"callFrames"`
// AsyncStackTrace (deprecated) (optional) Async stack trace, if any.
AsyncStackTrace *RuntimeStackTrace `json:"asyncStackTrace,omitempty"`
// AsyncStackTraceID (deprecated) (optional) Async stack trace, if any.
AsyncStackTraceID *RuntimeStackTraceID `json:"asyncStackTraceId,omitempty"`
}
// DebuggerResume Resumes JavaScript execution.
type DebuggerResume struct {
// TerminateOnResume (optional) 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.
TerminateOnResume bool `json:"terminateOnResume,omitempty"`
}
// ProtoReq name
func (m DebuggerResume) ProtoReq() string { return "Debugger.resume" }
// Call sends the request
func (m DebuggerResume) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSearchInContent Searches for given string in script content.
type DebuggerSearchInContent struct {
// ScriptID Id of the script to search in.
ScriptID RuntimeScriptID `json:"scriptId"`
// Query String to search for.
Query string `json:"query"`
// CaseSensitive (optional) If true, search is case sensitive.
CaseSensitive bool `json:"caseSensitive,omitempty"`
// IsRegex (optional) If true, treats string parameter as regex.
IsRegex bool `json:"isRegex,omitempty"`
}
// ProtoReq name
func (m DebuggerSearchInContent) ProtoReq() string { return "Debugger.searchInContent" }
// Call the request
func (m DebuggerSearchInContent) Call(c Client) (*DebuggerSearchInContentResult, error) {
var res DebuggerSearchInContentResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSearchInContentResult ...
type DebuggerSearchInContentResult struct {
// Result List of search matches.
Result []*DebuggerSearchMatch `json:"result"`
}
// DebuggerSetAsyncCallStackDepth Enables or disables async call stacks tracking.
type DebuggerSetAsyncCallStackDepth struct {
// MaxDepth Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
// call stacks (default).
MaxDepth int `json:"maxDepth"`
}
// ProtoReq name
func (m DebuggerSetAsyncCallStackDepth) ProtoReq() string { return "Debugger.setAsyncCallStackDepth" }
// Call sends the request
func (m DebuggerSetAsyncCallStackDepth) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetBlackboxPatterns (experimental) 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.
type DebuggerSetBlackboxPatterns struct {
// Patterns Array of regexps that will be used to check script url for blackbox state.
Patterns []string `json:"patterns"`
}
// ProtoReq name
func (m DebuggerSetBlackboxPatterns) ProtoReq() string { return "Debugger.setBlackboxPatterns" }
// Call sends the request
func (m DebuggerSetBlackboxPatterns) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetBlackboxedRanges (experimental) 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.
type DebuggerSetBlackboxedRanges struct {
// ScriptID Id of the script.
ScriptID RuntimeScriptID `json:"scriptId"`
// Positions ...
Positions []*DebuggerScriptPosition `json:"positions"`
}
// ProtoReq name
func (m DebuggerSetBlackboxedRanges) ProtoReq() string { return "Debugger.setBlackboxedRanges" }
// Call sends the request
func (m DebuggerSetBlackboxedRanges) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetBreakpoint Sets JavaScript breakpoint at a given location.
type DebuggerSetBreakpoint struct {
// Location Location to set breakpoint in.
Location *DebuggerLocation `json:"location"`
// Condition (optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the
// breakpoint if this expression evaluates to true.
Condition string `json:"condition,omitempty"`
}
// ProtoReq name
func (m DebuggerSetBreakpoint) ProtoReq() string { return "Debugger.setBreakpoint" }
// Call the request
func (m DebuggerSetBreakpoint) Call(c Client) (*DebuggerSetBreakpointResult, error) {
var res DebuggerSetBreakpointResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSetBreakpointResult ...
type DebuggerSetBreakpointResult struct {
// BreakpointID Id of the created breakpoint for further reference.
BreakpointID DebuggerBreakpointID `json:"breakpointId"`
// ActualLocation Location this breakpoint resolved into.
ActualLocation *DebuggerLocation `json:"actualLocation"`
}
// DebuggerSetInstrumentationBreakpointInstrumentation enum
type DebuggerSetInstrumentationBreakpointInstrumentation string
const (
// DebuggerSetInstrumentationBreakpointInstrumentationBeforeScriptExecution enum const
DebuggerSetInstrumentationBreakpointInstrumentationBeforeScriptExecution DebuggerSetInstrumentationBreakpointInstrumentation = "beforeScriptExecution"
// DebuggerSetInstrumentationBreakpointInstrumentationBeforeScriptWithSourceMapExecution enum const
DebuggerSetInstrumentationBreakpointInstrumentationBeforeScriptWithSourceMapExecution DebuggerSetInstrumentationBreakpointInstrumentation = "beforeScriptWithSourceMapExecution"
)
// DebuggerSetInstrumentationBreakpoint Sets instrumentation breakpoint.
type DebuggerSetInstrumentationBreakpoint struct {
// Instrumentation Instrumentation name.
Instrumentation DebuggerSetInstrumentationBreakpointInstrumentation `json:"instrumentation"`
}
// ProtoReq name
func (m DebuggerSetInstrumentationBreakpoint) ProtoReq() string {
return "Debugger.setInstrumentationBreakpoint"
}
// Call the request
func (m DebuggerSetInstrumentationBreakpoint) Call(c Client) (*DebuggerSetInstrumentationBreakpointResult, error) {
var res DebuggerSetInstrumentationBreakpointResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSetInstrumentationBreakpointResult ...
type DebuggerSetInstrumentationBreakpointResult struct {
// BreakpointID Id of the created breakpoint for further reference.
BreakpointID DebuggerBreakpointID `json:"breakpointId"`
}
// DebuggerSetBreakpointByURL 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.
type DebuggerSetBreakpointByURL struct {
// LineNumber Line number to set breakpoint at.
LineNumber int `json:"lineNumber"`
// URL (optional) URL of the resources to set breakpoint on.
URL string `json:"url,omitempty"`
// URLRegex (optional) Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
// `urlRegex` must be specified.
URLRegex string `json:"urlRegex,omitempty"`
// ScriptHash (optional) Script hash of the resources to set breakpoint on.
ScriptHash string `json:"scriptHash,omitempty"`
// ColumnNumber (optional) Offset in the line to set breakpoint at.
ColumnNumber *int `json:"columnNumber,omitempty"`
// Condition (optional) Expression to use as a breakpoint condition. When specified, debugger will only stop on the
// breakpoint if this expression evaluates to true.
Condition string `json:"condition,omitempty"`
}
// ProtoReq name
func (m DebuggerSetBreakpointByURL) ProtoReq() string { return "Debugger.setBreakpointByUrl" }
// Call the request
func (m DebuggerSetBreakpointByURL) Call(c Client) (*DebuggerSetBreakpointByURLResult, error) {
var res DebuggerSetBreakpointByURLResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSetBreakpointByURLResult ...
type DebuggerSetBreakpointByURLResult struct {
// BreakpointID Id of the created breakpoint for further reference.
BreakpointID DebuggerBreakpointID `json:"breakpointId"`
// Locations List of the locations this breakpoint resolved into upon addition.
Locations []*DebuggerLocation `json:"locations"`
}
// DebuggerSetBreakpointOnFunctionCall (experimental) 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.
type DebuggerSetBreakpointOnFunctionCall struct {
// ObjectID Function object id.
ObjectID RuntimeRemoteObjectID `json:"objectId"`
// Condition (optional) Expression to use as a breakpoint condition. When specified, debugger will
// stop on the breakpoint if this expression evaluates to true.
Condition string `json:"condition,omitempty"`
}
// ProtoReq name
func (m DebuggerSetBreakpointOnFunctionCall) ProtoReq() string {
return "Debugger.setBreakpointOnFunctionCall"
}
// Call the request
func (m DebuggerSetBreakpointOnFunctionCall) Call(c Client) (*DebuggerSetBreakpointOnFunctionCallResult, error) {
var res DebuggerSetBreakpointOnFunctionCallResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSetBreakpointOnFunctionCallResult (experimental) ...
type DebuggerSetBreakpointOnFunctionCallResult struct {
// BreakpointID Id of the created breakpoint for further reference.
BreakpointID DebuggerBreakpointID `json:"breakpointId"`
}
// DebuggerSetBreakpointsActive Activates / deactivates all breakpoints on the page.
type DebuggerSetBreakpointsActive struct {
// Active New value for breakpoints active state.
Active bool `json:"active"`
}
// ProtoReq name
func (m DebuggerSetBreakpointsActive) ProtoReq() string { return "Debugger.setBreakpointsActive" }
// Call sends the request
func (m DebuggerSetBreakpointsActive) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetPauseOnExceptionsState enum
type DebuggerSetPauseOnExceptionsState string
const (
// DebuggerSetPauseOnExceptionsStateNone enum const
DebuggerSetPauseOnExceptionsStateNone DebuggerSetPauseOnExceptionsState = "none"
// DebuggerSetPauseOnExceptionsStateCaught enum const
DebuggerSetPauseOnExceptionsStateCaught DebuggerSetPauseOnExceptionsState = "caught"
// DebuggerSetPauseOnExceptionsStateUncaught enum const
DebuggerSetPauseOnExceptionsStateUncaught DebuggerSetPauseOnExceptionsState = "uncaught"
// DebuggerSetPauseOnExceptionsStateAll enum const
DebuggerSetPauseOnExceptionsStateAll DebuggerSetPauseOnExceptionsState = "all"
)
// DebuggerSetPauseOnExceptions 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`.
type DebuggerSetPauseOnExceptions struct {
// State Pause on exceptions mode.
State DebuggerSetPauseOnExceptionsState `json:"state"`
}
// ProtoReq name
func (m DebuggerSetPauseOnExceptions) ProtoReq() string { return "Debugger.setPauseOnExceptions" }
// Call sends the request
func (m DebuggerSetPauseOnExceptions) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetReturnValue (experimental) Changes return value in top frame. Available only at return break position.
type DebuggerSetReturnValue struct {
// NewValue New return value.
NewValue *RuntimeCallArgument `json:"newValue"`
}
// ProtoReq name
func (m DebuggerSetReturnValue) ProtoReq() string { return "Debugger.setReturnValue" }
// Call sends the request
func (m DebuggerSetReturnValue) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// DebuggerSetScriptSource 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.
type DebuggerSetScriptSource struct {
// ScriptID Id of the script to edit.
ScriptID RuntimeScriptID `json:"scriptId"`
// ScriptSource New content of the script.
ScriptSource string `json:"scriptSource"`
// DryRun (optional) If true the change will not actually be applied. Dry run may be used to get result
// description without actually modifying the code.
DryRun bool `json:"dryRun,omitempty"`
// AllowTopFrameEditing (experimental) (optional) If true, then `scriptSource` is allowed to change the function on top of the stack
// as long as the top-most stack frame is the only activation of that function.
AllowTopFrameEditing bool `json:"allowTopFrameEditing,omitempty"`
}
// ProtoReq name
func (m DebuggerSetScriptSource) ProtoReq() string { return "Debugger.setScriptSource" }
// Call the request
func (m DebuggerSetScriptSource) Call(c Client) (*DebuggerSetScriptSourceResult, error) {
var res DebuggerSetScriptSourceResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// DebuggerSetScriptSourceResultStatus enum
type DebuggerSetScriptSourceResultStatus string
const (
// DebuggerSetScriptSourceResultStatusOk enum const
DebuggerSetScriptSourceResultStatusOk DebuggerSetScriptSourceResultStatus = "Ok"
// DebuggerSetScriptSourceResultStatusCompileError enum const
DebuggerSetScriptSourceResultStatusCompileError DebuggerSetScriptSourceResultStatus = "CompileError"
// DebuggerSetScriptSourceResultStatusBlockedByActiveGenerator enum const
DebuggerSetScriptSourceResultStatusBlockedByActiveGenerator DebuggerSetScriptSourceResultStatus = "BlockedByActiveGenerator"
// DebuggerSetScriptSourceResultStatusBlockedByActiveFunction enum const
DebuggerSetScriptSourceResultStatusBlockedByActiveFunction DebuggerSetScriptSourceResultStatus = "BlockedByActiveFunction"
)
// DebuggerSetScriptSourceResult ...
type DebuggerSetScriptSourceResult struct {
// CallFrames (deprecated) (optional) New stack trace in case editing has happened while VM was stopped.
CallFrames []*DebuggerCallFrame `json:"callFrames,omitempty"`
// StackChanged (deprecated) (optional) Whether current call stack was modified after applying the changes.
StackChanged bool `json:"stackChanged,omitempty"`
// AsyncStackTrace (deprecated) (optional) Async stack trace, if any.
AsyncStackTrace *RuntimeStackTrace `json:"asyncStackTrace,omitempty"`
// AsyncStackTraceID (deprecated) (optional) Async stack trace, if any.
AsyncStackTraceID *RuntimeStackTraceID `json:"asyncStackTraceId,omitempty"`
// Status (experimental) Whether the operation was successful or not. Only `Ok` denotes a
// successful live edit while the other enum variants denote why
// the live edit failed.
Status DebuggerSetScriptSourceResultStatus `json:"status"`
// ExceptionDetails (optional) Exception details if any. Only present when `status` is `CompileError`.