diff options
Diffstat (limited to 'deps/v8/test/inspector/debugger')
58 files changed, 1134 insertions, 281 deletions
diff --git a/deps/v8/test/inspector/debugger/async-instrumentation-expected.txt b/deps/v8/test/inspector/debugger/async-instrumentation-expected.txt index a37b08bab7..001f393148 100644 --- a/deps/v8/test/inspector/debugger/async-instrumentation-expected.txt +++ b/deps/v8/test/inspector/debugger/async-instrumentation-expected.txt @@ -9,12 +9,12 @@ test (test.js:21:2) foo (test.js:10:2) -- Promise.then -- -test (test.js:12:14) +test (test.js:19:14) (anonymous) (expr1.js:0:0) foo (test.js:12:2) -- Promise.then -- -test (test.js:12:14) +test (test.js:19:14) (anonymous) (expr1.js:0:0) diff --git a/deps/v8/test/inspector/debugger/async-instrumentation.js b/deps/v8/test/inspector/debugger/async-instrumentation.js index 6de2ce7d2f..44116637c0 100644 --- a/deps/v8/test/inspector/debugger/async-instrumentation.js +++ b/deps/v8/test/inspector/debugger/async-instrumentation.js @@ -4,7 +4,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks async instrumentation enabled in the middle.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function foo() { // asyncTaskStarted debugger; @@ -20,9 +21,8 @@ function test() { resolve1(); // asyncTaskScheduled debugger; return p2; -} - -//# sourceURL=test.js`, 7, 26); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/async-promise-late-then-expected.txt b/deps/v8/test/inspector/debugger/async-promise-late-then-expected.txt index a2b4b96439..ab08d3d69b 100644 --- a/deps/v8/test/inspector/debugger/async-promise-late-then-expected.txt +++ b/deps/v8/test/inspector/debugger/async-promise-late-then-expected.txt @@ -1,16 +1,16 @@ Checks async stack for late .then handlers with gc foo1 (test.js:11:2) -- Promise.then -- -test (test.js:10:14) +test (test.js:18:14) (anonymous) (expr.js:0:0) foo1 (test.js:11:2) -- Promise.then -- -test (test.js:14:14) +test (test.js:22:14) (anonymous) (expr.js:0:0) foo1 (test.js:11:2) -- Promise.then -- -test (test.js:16:14) +test (test.js:24:14) (anonymous) (expr.js:0:0) diff --git a/deps/v8/test/inspector/debugger/async-promise-late-then.js b/deps/v8/test/inspector/debugger/async-promise-late-then.js index cad3c7ed86..9efa3fb98f 100644 --- a/deps/v8/test/inspector/debugger/async-promise-late-then.js +++ b/deps/v8/test/inspector/debugger/async-promise-late-then.js @@ -5,7 +5,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks async stack for late .then handlers with gc'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function foo1() { gc(); debugger; @@ -24,8 +25,8 @@ function test() { var p4 = p1.then(foo1); gc(); return Promise.all([p2,p3,p4]); -} -//# sourceURL=test.js`, 8, 26); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/async-set-timeout-expected.txt b/deps/v8/test/inspector/debugger/async-set-timeout-expected.txt index c7cbea72c5..80cbb1f317 100644 --- a/deps/v8/test/inspector/debugger/async-set-timeout-expected.txt +++ b/deps/v8/test/inspector/debugger/async-set-timeout-expected.txt @@ -2,10 +2,10 @@ Checks that async stack contains setTimeout inner1 (test.js:11:4) foo1 (test.js:14:2) -- setTimeout -- -inner2 (test.js:11:4) -foo2 (test.js:13:2) +inner2 (test.js:18:4) +foo2 (test.js:20:2) -- setTimeout -- -inner3 (test.js:18:4) -foo3 (test.js:20:2) +inner3 (test.js:25:4) +foo3 (test.js:27:2) (anonymous) (expr.js:0:0) diff --git a/deps/v8/test/inspector/debugger/async-set-timeout.js b/deps/v8/test/inspector/debugger/async-set-timeout.js index 30096b637f..ff1d69a7b9 100644 --- a/deps/v8/test/inspector/debugger/async-set-timeout.js +++ b/deps/v8/test/inspector/debugger/async-set-timeout.js @@ -4,7 +4,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks that async stack contains setTimeout'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` var resolveCallback; function foo1() { function inner1() { @@ -26,8 +27,8 @@ function foo3() { } inner3(); return promise; -} -//# sourceURL=test.js`, 7, 26); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/async-stack-created-frame-expected.txt b/deps/v8/test/inspector/debugger/async-stack-created-frame-expected.txt index 176ed99f2a..21e7dc1632 100644 --- a/deps/v8/test/inspector/debugger/async-stack-created-frame-expected.txt +++ b/deps/v8/test/inspector/debugger/async-stack-created-frame-expected.txt @@ -3,78 +3,78 @@ Checks created frame for async call chain Running test: testPromise foo1 (test.js:10:2) -- Promise.then -- -promise (test.js:12:14) +promise (test.js:20:14) (anonymous) (expr.js:0:0) Running test: testPromiseThen foo1 (test.js:10:2) -- Promise.then -- -promiseThen (test.js:20:14) +promiseThen (test.js:28:14) (anonymous) (expr.js:0:0) foo2 (test.js:14:2) -- Promise.then -- -promiseThen (test.js:21:14) +promiseThen (test.js:29:14) (anonymous) (expr.js:0:0) Running test: testPromiseThenThen foo1 (test.js:10:2) -- Promise.then -- -promiseThenThen (test.js:29:14) +promiseThenThen (test.js:37:14) (anonymous) (expr.js:0:0) foo1 (test.js:10:2) -- Promise.then -- -promiseThenThen (test.js:30:14) +promiseThenThen (test.js:38:14) (anonymous) (expr.js:0:0) foo2 (test.js:14:2) -- Promise.then -- -promiseThenThen (test.js:29:25) +promiseThenThen (test.js:37:25) (anonymous) (expr.js:0:0) Running test: testPromiseResolve foo1 (test.js:10:2) -- Promise.then -- -promiseResolve (test.js:36:27) +promiseResolve (test.js:44:27) (anonymous) (expr.js:0:0) Running test: testPromiseReject foo1 (test.js:10:2) -- Promise.catch -- -promiseReject (test.js:40:31) +promiseReject (test.js:48:31) (anonymous) (expr.js:0:0) Running test: testPromiseAll foo1 (test.js:10:2) -- Promise.then -- -promiseAll (test.js:44:44) +promiseAll (test.js:52:44) (anonymous) (expr.js:0:0) Running test: testPromiseRace foo1 (test.js:10:2) -- Promise.then -- -promiseRace (test.js:48:45) +promiseRace (test.js:56:45) (anonymous) (expr.js:0:0) Running test: testThenableJob1 foo1 (test.js:10:2) -- Promise.then -- -thenableJob1 (test.js:52:72) +thenableJob1 (test.js:60:72) (anonymous) (expr.js:0:0) Running test: testThenableJob2 foo1 (test.js:10:2) -- Promise.then -- -thenableJob2 (test.js:56:57) +thenableJob2 (test.js:64:57) (anonymous) (expr.js:0:0) @@ -82,10 +82,10 @@ Running test: testSetTimeouts foo1 (test.js:10:2) (anonymous) (test.js:72:25) -- setTimeout -- -(anonymous) (test.js:64:6) +(anonymous) (test.js:72:6) -- setTimeout -- -(anonymous) (test.js:63:4) +(anonymous) (test.js:71:4) -- setTimeout -- -setTimeouts (test.js:62:2) +setTimeouts (test.js:70:2) (anonymous) (expr.js:0:0) diff --git a/deps/v8/test/inspector/debugger/async-stack-created-frame.js b/deps/v8/test/inspector/debugger/async-stack-created-frame.js index 0f2c7a1e78..c65c5499b4 100644 --- a/deps/v8/test/inspector/debugger/async-stack-created-frame.js +++ b/deps/v8/test/inspector/debugger/async-stack-created-frame.js @@ -5,7 +5,7 @@ // TODO(kozyatinskiy): fix this test. let {session, contextGroup, Protocol} = InspectorTest.start('Checks created frame for async call chain'); -contextGroup.addScript( +contextGroup.addInlineScript( ` function foo1() { debugger; @@ -72,10 +72,8 @@ function setTimeouts() { setTimeout(() => setTimeout(() => { foo1(); resolve(); }, 0), 0), 0); return p; -} - -//# sourceURL=test.js`, - 8, 4); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/async-stack-for-promise-expected.txt b/deps/v8/test/inspector/debugger/async-stack-for-promise-expected.txt index 4de838252e..86860fdb39 100644 --- a/deps/v8/test/inspector/debugger/async-stack-for-promise-expected.txt +++ b/deps/v8/test/inspector/debugger/async-stack-for-promise-expected.txt @@ -3,94 +3,94 @@ Checks that async chains for promises are correct. Running test: testPromise foo1 (test.js:9:2) -- Promise.then -- -promise (test.js:12:14) +promise (test.js:19:14) (anonymous) (testPromise.js:0:0) Running test: testPromiseResolvedBySetTimeout foo1 (test.js:9:2) -- Promise.then -- -promiseResolvedBySetTimeout (test.js:20:14) +promiseResolvedBySetTimeout (test.js:27:14) (anonymous) (testPromiseResolvedBySetTimeout.js:0:0) Running test: testPromiseAll foo1 (test.js:9:2) -- Promise.then -- -promiseAll (test.js:30:35) +promiseAll (test.js:37:35) (anonymous) (testPromiseAll.js:0:0) Running test: testPromiseAllReverseOrder foo1 (test.js:9:2) -- Promise.then -- -promiseAllReverseOrder (test.js:41:35) +promiseAllReverseOrder (test.js:48:35) (anonymous) (testPromiseAllReverseOrder.js:0:0) Running test: testPromiseRace foo1 (test.js:9:2) -- Promise.then -- -promiseRace (test.js:52:36) +promiseRace (test.js:59:36) (anonymous) (testPromiseRace.js:0:0) Running test: testTwoChainedCallbacks foo1 (test.js:9:2) -- Promise.then -- -twoChainedCallbacks (test.js:61:14) +twoChainedCallbacks (test.js:68:14) (anonymous) (testTwoChainedCallbacks.js:0:0) foo2 (test.js:13:2) -- Promise.then -- -twoChainedCallbacks (test.js:61:25) +twoChainedCallbacks (test.js:68:25) (anonymous) (testTwoChainedCallbacks.js:0:0) Running test: testPromiseResolve foo1 (test.js:9:2) -- Promise.then -- -promiseResolve (test.js:67:27) +promiseResolve (test.js:74:27) (anonymous) (testPromiseResolve.js:0:0) foo2 (test.js:13:2) -- Promise.then -- -promiseResolve (test.js:67:38) +promiseResolve (test.js:74:38) (anonymous) (testPromiseResolve.js:0:0) Running test: testThenableJobResolvedInSetTimeout foo1 (test.js:9:2) -- Promise.then -- -thenableJobResolvedInSetTimeout (test.js:79:40) +thenableJobResolvedInSetTimeout (test.js:86:40) (anonymous) (testThenableJobResolvedInSetTimeout.js:0:0) Running test: testThenableJobResolvedInSetTimeoutWithStack foo1 (test.js:9:2) -- Promise.then -- -thenableJobResolvedInSetTimeoutWithStack (test.js:97:40) +thenableJobResolvedInSetTimeoutWithStack (test.js:104:40) (anonymous) (testThenableJobResolvedInSetTimeoutWithStack.js:0:0) Running test: testThenableJobResolvedByPromise foo1 (test.js:9:2) -- Promise.then -- -thenableJobResolvedByPromise (test.js:111:40) +thenableJobResolvedByPromise (test.js:118:40) (anonymous) (testThenableJobResolvedByPromise.js:0:0) Running test: testThenableJobResolvedByPromiseWithStack foo1 (test.js:9:2) -- Promise.then -- -thenableJobResolvedByPromiseWithStack (test.js:129:40) +thenableJobResolvedByPromiseWithStack (test.js:136:40) (anonymous) (testThenableJobResolvedByPromiseWithStack.js:0:0) Running test: testLateThenCallback foo1 (test.js:9:2) -- Promise.then -- -lateThenCallback (test.js:138:12) +lateThenCallback (test.js:145:12) (anonymous) (testLateThenCallback.js:0:0) @@ -98,36 +98,36 @@ Running test: testComplex inner1 (test.js:154:6) foo1 (test.js:156:4) -- Promise.then -- -complex (test.js:195:5) +complex (test.js:202:5) (anonymous) (testComplex.js:0:0) (anonymous) (test.js:207:8) -- Promise.then -- -(anonymous) (test.js:199:8) +(anonymous) (test.js:206:8) -- Promise.then -- -(anonymous) (test.js:198:6) +(anonymous) (test.js:205:6) -- setTimeout -- -complex (test.js:197:2) +complex (test.js:204:2) (anonymous) (testComplex.js:0:0) Running test: testReject foo1 (test.js:9:2) -- Promise.catch -- -reject (test.js:210:31) +reject (test.js:217:31) (anonymous) (testReject.js:0:0) Running test: testFinally1 foo1 (test.js:9:2) -- Promise.finally -- -finally1 (test.js:214:33) +finally1 (test.js:221:33) (anonymous) (testFinally1.js:0:0) Running test: testFinally2 foo1 (test.js:9:2) -- Promise.finally -- -finally2 (test.js:218:34) +finally2 (test.js:225:34) (anonymous) (testFinally2.js:0:0) diff --git a/deps/v8/test/inspector/debugger/async-stack-for-promise.js b/deps/v8/test/inspector/debugger/async-stack-for-promise.js index 79c3261263..6aaba6dba1 100644 --- a/deps/v8/test/inspector/debugger/async-stack-for-promise.js +++ b/deps/v8/test/inspector/debugger/async-stack-for-promise.js @@ -4,7 +4,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks that async chains for promises are correct.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function foo1() { debugger; } @@ -223,8 +224,8 @@ function finally1() { function finally2() { return Promise.resolve().finally(foo1); -} -//# sourceURL=test.js`, 7, 26); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/async-stack-load-more-expected.txt b/deps/v8/test/inspector/debugger/async-stack-load-more-expected.txt index 80225b1618..27ee79fb33 100644 --- a/deps/v8/test/inspector/debugger/async-stack-load-more-expected.txt +++ b/deps/v8/test/inspector/debugger/async-stack-load-more-expected.txt @@ -1,4 +1,6 @@ Tests super long async stacks. + +Running test: test (anonymous) (expr.js:0:26) callWithAsyncStack (utils.js:3:4) call1 (wrapper.js:0:20) diff --git a/deps/v8/test/inspector/debugger/async-stack-load-more.js b/deps/v8/test/inspector/debugger/async-stack-load-more.js index 3aaaa13076..dcc3c6c798 100644 --- a/deps/v8/test/inspector/debugger/async-stack-load-more.js +++ b/deps/v8/test/inspector/debugger/async-stack-load-more.js @@ -15,7 +15,9 @@ function callWithAsyncStack(f, depth) { } //# sourceURL=utils.js`); -(async function test() { +session.setupScriptMap(); + +InspectorTest.runAsyncTestSuite([async function test() { Protocol.Debugger.enable(); Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 4}); Protocol.Runtime.evaluate({ @@ -40,5 +42,4 @@ function callWithAsyncStack(f, depth) { break; } } - InspectorTest.completeTest(); -})() +}]); diff --git a/deps/v8/test/inspector/debugger/call-frame-url-expected.txt b/deps/v8/test/inspector/debugger/call-frame-url-expected.txt index b27b40dd3d..e19908fefb 100644 --- a/deps/v8/test/inspector/debugger/call-frame-url-expected.txt +++ b/deps/v8/test/inspector/debugger/call-frame-url-expected.txt @@ -4,12 +4,12 @@ Tests url in Debugger.CallFrame. url : } [1] : { - url : source-url.js + url : } [2] : { - url : test.js + url : } [3] : { - url : expr.js + url : } ] diff --git a/deps/v8/test/inspector/debugger/class-private-methods-expected.txt b/deps/v8/test/inspector/debugger/class-private-methods-expected.txt index 19a944eebd..21da2d844c 100644 --- a/deps/v8/test/inspector/debugger/class-private-methods-expected.txt +++ b/deps/v8/test/inspector/debugger/class-private-methods-expected.txt @@ -1,7 +1,7 @@ Test private class methods Running test: testScopesPaused -privateProperties on the base class instance +private properties on the base class instance [ [0] : { name : #inc @@ -54,6 +54,42 @@ privateProperties on the base class instance } } ] +private accessors properties on the base class instance +[ + [0] : { + name : #writeOnly + set : { + className : Function + description : set #writeOnly(val) { this.#field = val; } + objectId : <objectId> + type : function + } + } + [1] : { + get : { + className : Function + description : get #readOnly() { return this.#field; } + objectId : <objectId> + type : function + } + name : #readOnly + } + [2] : { + get : { + className : Function + description : get #accessor() { return this.#field; } + objectId : <objectId> + type : function + } + name : #accessor + set : { + className : Function + description : set #accessor(val) { this.#field = val; } + objectId : <objectId> + type : function + } + } +] Evaluating private methods { result : { diff --git a/deps/v8/test/inspector/debugger/class-private-methods-nested-super-expected.txt b/deps/v8/test/inspector/debugger/class-private-methods-nested-super-expected.txt new file mode 100644 index 0000000000..4e1b681a19 --- /dev/null +++ b/deps/v8/test/inspector/debugger/class-private-methods-nested-super-expected.txt @@ -0,0 +1,66 @@ +Test getting private class methods from an instance that calls nested super() + +Running test: testScopesPaused +properties after super() is called in IIFE +[ + [0] : { + name : #b + value : { + className : Function + description : #b() {} + objectId : <objectId> + type : function + } + } +] +privateProperties after super() is called in arrow function +[ + [0] : { + name : #b + value : { + className : Function + description : #b() {} + objectId : <objectId> + type : function + } + } + [1] : { + get : { + className : Function + description : get #c() {} + objectId : <objectId> + type : function + } + name : #c + } +] +privateProperties after super() is called in eval() +[ + [0] : { + name : #b + value : { + className : Function + description : #b() {} + objectId : <objectId> + type : function + } + } + [1] : { + get : { + className : Function + description : get #c() {} + objectId : <objectId> + type : function + } + name : #c + } + [2] : { + name : #d + set : { + className : Function + description : set #d(val) {} + objectId : <objectId> + type : function + } + } +] diff --git a/deps/v8/test/inspector/debugger/class-private-methods-nested-super.js b/deps/v8/test/inspector/debugger/class-private-methods-nested-super.js new file mode 100644 index 0000000000..5a8452f55c --- /dev/null +++ b/deps/v8/test/inspector/debugger/class-private-methods-nested-super.js @@ -0,0 +1,79 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +let { session, contextGroup, Protocol } = InspectorTest.start( + "Test getting private class methods from an instance that calls nested super()" +); + +contextGroup.addScript(` +function run() { + class A {} + class B extends A { + #b() {} + constructor() { + (() => super())(); + } + test() { debugger; } + }; + (new B()).test(); + + class C extends B { + get #c() {} + constructor() { + const callSuper = () => super(); + callSuper(); + } + test() { debugger; } + }; + (new C()).test(); + + class D extends C { + set #d(val) {} + constructor(str) { + eval(str); + } + test() { debugger; } + }; + (new D('super();')).test(); +}`); + +InspectorTest.runAsyncTestSuite([ + async function testScopesPaused() { + Protocol.Debugger.enable(); + Protocol.Runtime.evaluate({ expression: "run()" }); + + let { + params: { callFrames } + } = await Protocol.Debugger.oncePaused(); // inside B constructor + let frame = callFrames[0]; + let { result } = await Protocol.Runtime.getProperties({ + objectId: frame.this.objectId + }); + + InspectorTest.log('properties after super() is called in IIFE'); + InspectorTest.logMessage(result.privateProperties); + Protocol.Debugger.resume(); + + ({ params: { callFrames } } + = await Protocol.Debugger.oncePaused()); // inside C constructor + frame = callFrames[0]; + ({ result } = await Protocol.Runtime.getProperties({ + objectId: frame.this.objectId + })); + InspectorTest.log('privateProperties after super() is called in arrow function'); + InspectorTest.logMessage(result.privateProperties); + Protocol.Debugger.resume(); + ({ params: { callFrames } } + = await Protocol.Debugger.oncePaused()); // inside D constructor + frame = callFrames[0]; + ({ result } = await Protocol.Runtime.getProperties({ + objectId: frame.this.objectId + })); + InspectorTest.log('privateProperties after super() is called in eval()'); + InspectorTest.logMessage(result.privateProperties); + Protocol.Debugger.resume(); + + Protocol.Debugger.disable(); + } +]); diff --git a/deps/v8/test/inspector/debugger/class-private-methods.js b/deps/v8/test/inspector/debugger/class-private-methods.js index f86ea6dee1..86839f87d6 100644 --- a/deps/v8/test/inspector/debugger/class-private-methods.js +++ b/deps/v8/test/inspector/debugger/class-private-methods.js @@ -56,7 +56,15 @@ InspectorTest.runAsyncTestSuite([ objectId: frame.this.objectId }); - InspectorTest.log('privateProperties on the base class instance'); + InspectorTest.log('private properties on the base class instance'); + InspectorTest.logMessage(result.privateProperties); + + ({ result } = await Protocol.Runtime.getProperties({ + objectId: frame.this.objectId, + accessorPropertiesOnly: true, + })); + + InspectorTest.log('private accessors properties on the base class instance'); InspectorTest.logMessage(result.privateProperties); ({ result } = await Protocol.Debugger.evaluateOnCallFrame({ diff --git a/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames-expected.txt b/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames-expected.txt index a3b6826878..3c541d3496 100644 --- a/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames-expected.txt +++ b/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames-expected.txt @@ -8,9 +8,9 @@ asyncFact (test.js:9:2) asyncFact (test.js:11:2) -- await -- -asyncFact (test.js:3:20) -asyncFact (test.js:3:20) -asyncFact (test.js:3:20) +asyncFact (test.js:10:20) +asyncFact (test.js:10:20) +asyncFact (test.js:10:20) (anonymous) (expr.js:0:0) diff --git a/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames.js b/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames.js index c33ff6b93c..02962781f8 100644 --- a/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames.js +++ b/deps/v8/test/inspector/debugger/continue-to-location-target-call-frames.js @@ -4,7 +4,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Check that continue-to-location works with different strategies.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` async function asyncFact(n) { if (n == 0) return 1; let r = n * await asyncFact(n - 1); @@ -20,15 +21,18 @@ function fact(n) { } function topLevel() { - eval(` + '`' + ` + eval(` + + '`' + + ` var a = 1; var b = 2; fact(3); console.log(a + b); - ` + '`' + `); -} - -//# sourceURL=test.js`, 7, 26); + ` + + '`' + + `); +}`, + 'test.js'); session.setupScriptMap(); InspectorTest.runAsyncTestSuite([ diff --git a/deps/v8/test/inspector/debugger/destroy-in-break-program2.js b/deps/v8/test/inspector/debugger/destroy-in-break-program2.js index 94df496520..b0a6566905 100644 --- a/deps/v8/test/inspector/debugger/destroy-in-break-program2.js +++ b/deps/v8/test/inspector/debugger/destroy-in-break-program2.js @@ -27,6 +27,7 @@ const {session, contextGroup, Protocol} = InspectorTest.start( const contextGroup = new InspectorTest.ContextGroup(); const session2 = contextGroup.connect(); const Protocol2 = session2.Protocol; + session2.setupScriptMap(); Protocol2.Runtime.enable(); Protocol2.Debugger.enable(); @@ -40,7 +41,8 @@ const {session, contextGroup, Protocol} = InspectorTest.start( }); const paused = (await Protocol2.Debugger.oncePaused()).params; - InspectorTest.log(`paused in: ${paused.callFrames[0].url}`); + InspectorTest.log( + `paused in: ${session2.getCallFrameUrl(paused.callFrames[0])}`); // Now if we're paused in the wrong place, we will likely crash. session2.disconnect(); diff --git a/deps/v8/test/inspector/debugger/external-stack-trace.js b/deps/v8/test/inspector/debugger/external-stack-trace.js index 78725937c2..fe1a0346c7 100644 --- a/deps/v8/test/inspector/debugger/external-stack-trace.js +++ b/deps/v8/test/inspector/debugger/external-stack-trace.js @@ -11,6 +11,9 @@ let contextGroup2 = new InspectorTest.ContextGroup(); let session2 = contextGroup2.connect(); let Protocol2 = session2.Protocol; +session1.setupScriptMap(); +session2.setupScriptMap(); + let utilsScript = ` function store(description) { let buffer = inspector.storeCurrentStackTrace(description); @@ -23,11 +26,10 @@ function started(id) { function finished(id) { inspector.externalAsyncTaskFinished(Int32Array.from(JSON.parse(id)).buffer); -} -//# sourceURL=utils.js`; +}`; -contextGroup1.addScript(utilsScript); -contextGroup2.addScript(utilsScript); +contextGroup1.addScript(utilsScript, 0, 0, 'utils.js'); +contextGroup2.addScript(utilsScript, 0, 0, 'utils.js'); InspectorTest.runAsyncTestSuite([ async function testDebuggerId() { diff --git a/deps/v8/test/inspector/debugger/framework-break-expected.txt b/deps/v8/test/inspector/debugger/framework-break-expected.txt index b8469f4ecb..414a72a4ac 100644 --- a/deps/v8/test/inspector/debugger/framework-break-expected.txt +++ b/deps/v8/test/inspector/debugger/framework-break-expected.txt @@ -20,7 +20,7 @@ throwUncaughtError (framework.js:21:2) Running test: testUncaughtExceptionWithInlinedFrame > mixed top frame in framework: -throwUserException (user.js:66:2) +throwUserException (user.js:76:2) inlinedWrapper (framework.js:56:4) throwInlinedUncaughtError (framework.js:60:2) (anonymous) (framework.js:0:0) @@ -50,7 +50,7 @@ syncDOMBreakpoint (framework.js:33:12) Running test: testSyncDOMBreakpointWithInlinedUserFrame > mixed, top frame in framework: syncDOMBreakpoint (framework.js:33:12) -userFunction (user.js:70:2) +userFunction (user.js:80:2) inlinedWrapper (framework.js:65:4) syncDOMBreakpointWithInlinedUserFrame (framework.js:69:2) (anonymous) (framework.js:0:0) diff --git a/deps/v8/test/inspector/debugger/framework-break.js b/deps/v8/test/inspector/debugger/framework-break.js index 45cdf5c2b2..04455d9b0f 100644 --- a/deps/v8/test/inspector/debugger/framework-break.js +++ b/deps/v8/test/inspector/debugger/framework-break.js @@ -5,7 +5,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks that breaks in framework code correctly processed.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function frameworkAssert() { console.assert(false); } @@ -67,20 +68,19 @@ function syncDOMBreakpointWithInlinedUserFrame() { %PrepareFunctionForOptimization(inlinedWrapper); %OptimizeFunctionOnNextCall(inlinedWrapper); inlinedWrapper(); -} - -//# sourceURL=framework.js`, 8, 26); +}`, + 'framework.js'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function throwUserException() { throw new Error(); } function userFunction() { syncDOMBreakpoint(); -} - -//# sourceURL=user.js`, 64, 26) +}`, + 'user.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/framework-nested-scheduled-break.js b/deps/v8/test/inspector/debugger/framework-nested-scheduled-break.js index 3e6299154d..721097d84f 100644 --- a/deps/v8/test/inspector/debugger/framework-nested-scheduled-break.js +++ b/deps/v8/test/inspector/debugger/framework-nested-scheduled-break.js @@ -4,7 +4,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks nested scheduled break in framework code.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function frameworkCall(callback) { inspector.callWithScheduledBreak(doFrameworkWork.bind(null, callback), 'top-framework-scheduled-break', @@ -18,11 +19,11 @@ function doFrameworkWork(callback) { function doFrameworkBreak() { inspector.breakProgram('framework-break', JSON.stringify({ data: 'data for framework-break' })); -} - -//# sourceURL=framework.js`, 7, 26); +}`, + 'framework.js'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function testFunction() { inspector.callWithScheduledBreak(frameworkCall.bind(null, callback), 'top-scheduled-break', ''); @@ -31,9 +32,8 @@ function testFunction() { function callback() { inspector.breakProgram('user-break', JSON.stringify({ data: 'data for user-break' })); return 42; -} - -//# sourceURL=user.js`, 25, 26); +}`, + 'user.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/framework-precise-ranges.js b/deps/v8/test/inspector/debugger/framework-precise-ranges.js index 4f76033a96..1ecd1703e8 100644 --- a/deps/v8/test/inspector/debugger/framework-precise-ranges.js +++ b/deps/v8/test/inspector/debugger/framework-precise-ranges.js @@ -4,7 +4,7 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks framework debugging with blackboxed ranges.'); -contextGroup.addScript( +contextGroup.addInlineScript( ` function foo() { return boo(); @@ -14,9 +14,8 @@ function boo() { } function testFunction() { foo(); -} -//# sourceURL=test.js`, - 7, 26); +}`, + 'test.js'); session.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/deps/v8/test/inspector/debugger/framework-stepping-expected.txt b/deps/v8/test/inspector/debugger/framework-stepping-expected.txt index fa2bb35f5a..346ca93766 100644 --- a/deps/v8/test/inspector/debugger/framework-stepping-expected.txt +++ b/deps/v8/test/inspector/debugger/framework-stepping-expected.txt @@ -5,21 +5,21 @@ Running test: testStepIntoFromUser Executing stepInto... Executing stepInto... -userFoo (user.js:23:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userFoo (user.js:21:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing stepInto... Executing stepInto... -userBoo (user.js:27:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userBoo (user.js:25:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing stepInto... Executing stepInto... -testStepFromUser (user.js:32:0) +testStepFromUser (user.js:30:0) (anonymous) (expr.js:0:0) Executing resume... @@ -29,21 +29,21 @@ Running test: testStepOverFromUser Executing stepInto... Executing stepInto... -userFoo (user.js:23:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userFoo (user.js:21:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing stepOver... Executing stepOver... -userBoo (user.js:27:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userBoo (user.js:25:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing stepOver... Executing stepOver... -testStepFromUser (user.js:32:0) +testStepFromUser (user.js:30:0) (anonymous) (expr.js:0:0) Executing resume... @@ -53,50 +53,50 @@ Running test: testStepOutFromUser Executing stepInto... Executing stepInto... -userFoo (user.js:23:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userFoo (user.js:21:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing stepOut... -userBoo (user.js:27:2) -frameworkCall (framework.js:10:23) -testStepFromUser (user.js:31:2) +userBoo (user.js:25:2) +frameworkCall (framework.js:9:23) +testStepFromUser (user.js:29:2) (anonymous) (expr.js:0:0) Executing resume... Running test: testStepIntoFromFramework -frameworkBreakAndCall (framework.js:14:12) -testStepFromFramework (user.js:35:2) +frameworkBreakAndCall (framework.js:13:12) +testStepFromFramework (user.js:33:2) (anonymous) (expr.js:0:0) Executing stepInto... -userFoo (user.js:23:2) -frameworkBreakAndCall (framework.js:15:23) -testStepFromFramework (user.js:35:2) +userFoo (user.js:21:2) +frameworkBreakAndCall (framework.js:14:23) +testStepFromFramework (user.js:33:2) (anonymous) (expr.js:0:0) Executing resume... Running test: testStepOverFromFramework -frameworkBreakAndCall (framework.js:14:12) -testStepFromFramework (user.js:35:2) +frameworkBreakAndCall (framework.js:13:12) +testStepFromFramework (user.js:33:2) (anonymous) (expr.js:0:0) Executing stepOver... -testStepFromFramework (user.js:36:0) +testStepFromFramework (user.js:34:0) (anonymous) (expr.js:0:0) Executing resume... Running test: testStepOutFromFramework -frameworkBreakAndCall (framework.js:14:12) -testStepFromFramework (user.js:35:2) +frameworkBreakAndCall (framework.js:13:12) +testStepFromFramework (user.js:33:2) (anonymous) (expr.js:0:0) Executing stepOut... -testStepFromFramework (user.js:36:0) +testStepFromFramework (user.js:34:0) (anonymous) (expr.js:0:0) Executing resume... diff --git a/deps/v8/test/inspector/debugger/framework-stepping.js b/deps/v8/test/inspector/debugger/framework-stepping.js index f91c06ba52..3ce20d8801 100644 --- a/deps/v8/test/inspector/debugger/framework-stepping.js +++ b/deps/v8/test/inspector/debugger/framework-stepping.js @@ -4,7 +4,7 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Checks stepping with blackboxed frames on stack'); -contextGroup.addScript( +contextGroup.addInlineScript( ` function frameworkCall(funcs) { for (var f of funcs) f(); @@ -13,11 +13,10 @@ function frameworkCall(funcs) { function frameworkBreakAndCall(funcs) { inspector.breakProgram('', ''); for (var f of funcs) f(); -} -//# sourceURL=framework.js`, - 8, 4); +}`, + 'framework.js'); -contextGroup.addScript( +contextGroup.addInlineScript( ` function userFoo() { return 1; @@ -33,9 +32,8 @@ function testStepFromUser() { function testStepFromFramework() { frameworkBreakAndCall([userFoo, userBoo]); -} -//# sourceURL=user.js`, - 21, 4); +}`, + 'user.js'); session.setupScriptMap(); diff --git a/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc-expected.txt b/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc-expected.txt index 6968ed3eab..4362e8dd6a 100644 --- a/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc-expected.txt +++ b/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc-expected.txt @@ -1,7 +1,5 @@ Checks if we keep alive breakpoint information for top-level functions when calling getPossibleBreakpoints. -Result of get possible breakpoints in topLevel.js -[{"scriptId":"3","lineNumber":0,"columnNumber":0},{"scriptId":"3","lineNumber":0,"columnNumber":8,"type":"call"},{"scriptId":"3","lineNumber":0,"columnNumber":43,"type":"return"}] Result of get possible breakpoints in moduleFunc.js -[{"scriptId":"5","lineNumber":0,"columnNumber":22},{"scriptId":"5","lineNumber":0,"columnNumber":30,"type":"call"},{"scriptId":"5","lineNumber":0,"columnNumber":63,"type":"return"},{"scriptId":"5","lineNumber":0,"columnNumber":64,"type":"return"}] +[{"scriptId":"3","lineNumber":0,"columnNumber":22},{"scriptId":"3","lineNumber":0,"columnNumber":30,"type":"call"},{"scriptId":"3","lineNumber":0,"columnNumber":63,"type":"return"},{"scriptId":"3","lineNumber":0,"columnNumber":64,"type":"return"}] Result of get possible breakpoints in mixedFunctions.js -[{"scriptId":"7","lineNumber":0,"columnNumber":15,"type":"return"},{"scriptId":"7","lineNumber":1,"columnNumber":2},{"scriptId":"7","lineNumber":1,"columnNumber":10,"type":"call"},{"scriptId":"7","lineNumber":2,"columnNumber":0,"type":"return"}] +[{"scriptId":"5","lineNumber":0,"columnNumber":15,"type":"return"},{"scriptId":"5","lineNumber":1,"columnNumber":2},{"scriptId":"5","lineNumber":1,"columnNumber":10,"type":"call"},{"scriptId":"5","lineNumber":2,"columnNumber":0,"type":"return"}] diff --git a/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc.js b/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc.js index 097d0b99af..da281a47fc 100644 --- a/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc.js +++ b/deps/v8/test/inspector/debugger/get-possible-breakpoints-after-gc.js @@ -17,7 +17,6 @@ const callGarbageCollector = ` %CollectGarbage(""); `; -const topLevelFunction = `console.log('This is a top level function')`; const moduleFunction = `function testFunc() { console.log('This is a module function') }`; let mixedFunctions = ` function A() {} @@ -34,8 +33,6 @@ function onDebuggerEnabled() { async function onExecutionContextCreated(messageObject) { executionContextId = messageObject.params.context.id; await testGetPossibleBreakpoints( - executionContextId, topLevelFunction, 'topLevel.js'); - await testGetPossibleBreakpoints( executionContextId, moduleFunction, 'moduleFunc.js'); await testGetPossibleBreakpoints( executionContextId, mixedFunctions, 'mixedFunctions.js'); diff --git a/deps/v8/test/inspector/debugger/other-pause-reasons-expected.txt b/deps/v8/test/inspector/debugger/other-pause-reasons-expected.txt index e5dc5542f2..475fa67d5a 100644 --- a/deps/v8/test/inspector/debugger/other-pause-reasons-expected.txt +++ b/deps/v8/test/inspector/debugger/other-pause-reasons-expected.txt @@ -1,23 +1,37 @@ Test that all 'other' reasons are explicitly encoded on a pause event if they overlap with another reason Running test: testBreakpointPauseReason -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"foo.js","scriptId":"3"}},{"reason":"other"}]}. +Paused with reason instrumentation, data {"scriptId":"3","url":"foo.js"} and scriptId: 3. +Paused with reason other, data {} and scriptId: 3. Running test: testTriggeredPausePauseReason -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"foo.js","scriptId":"4"}},{"reason":"other"}]}. +Paused with reason instrumentation, data {"scriptId":"4","url":"foo.js"} and scriptId: 4. +Paused with reason other, data {} and scriptId: 4. Running test: testSteppingPauseReason -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"foo.js","scriptId":"5"}},{"reason":"other"}]}. -Paused with reason: other and data: {}. -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"bar.js","scriptId":"6"}},{"reason":"other"}]}. +Paused with reason instrumentation, data {"scriptId":"5","url":"foo.js"} and scriptId: 5. +Paused with reason other, data {} and scriptId: 5. +Paused with reason other, data {} and scriptId: 5. +Paused with reason instrumentation, data {"scriptId":"6","url":"bar.js"} and scriptId: 6. +Paused with reason other, data {} and scriptId: 6. Running test: testOnlyReportOtherWithEmptyDataOnce -Paused with reason: other and data: {}. +Paused with reason other, data {} and scriptId: 7. Running test: testDebuggerStatementReason -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"foo.js","scriptId":"8"}},{"reason":"other"}]}. +Paused with reason instrumentation, data {"scriptId":"8","url":"foo.js"} and scriptId: 8. +Paused with reason other, data {} and scriptId: 8. Running test: testAsyncSteppingPauseReason -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"foo.js","scriptId":"9"}},{"reason":"other"}]}. -Paused with reason: other and data: {}. -Paused with reason: ambiguous and data: {"reasons":[{"reason":"instrumentation","auxData":{"url":"bar.js","scriptId":"10"}},{"reason":"other"}]}. +Paused with reason instrumentation, data {"scriptId":"9","url":"foo.js"} and scriptId: 9. +Paused with reason other, data {} and scriptId: 9. +Paused with reason other, data {} and scriptId: 9. +Paused with reason instrumentation, data {"scriptId":"10","url":"bar.js"} and scriptId: 10. +Paused with reason other, data {} and scriptId: 10. +Paused with reason other, data {} and scriptId: 10. + +Running test: testSteppingOutPauseReason +Paused with reason instrumentation, data {"scriptId":"11","url":"foo.js"} and scriptId: 11. +Paused with reason other, data {} and scriptId: 11. +Paused with reason instrumentation, data {"scriptId":"12","url":"bar.js"} and scriptId: 12. +Paused with reason other, data {} and scriptId: 11. diff --git a/deps/v8/test/inspector/debugger/other-pause-reasons.js b/deps/v8/test/inspector/debugger/other-pause-reasons.js index 41520ae734..b307bd516b 100644 --- a/deps/v8/test/inspector/debugger/other-pause-reasons.js +++ b/deps/v8/test/inspector/debugger/other-pause-reasons.js @@ -5,12 +5,22 @@ const { session, contextGroup, Protocol } = InspectorTest.start( `Test that all 'other' reasons are explicitly encoded on a pause event if they overlap with another reason`); -function resumeOnPause({params: {reason, data}}) { - InspectorTest.log(`Paused with reason: ${reason} and data: ${ - data ? JSON.stringify(data) : '{}'}.`) - Protocol.Debugger.resume(); +function handlePause( + noInstrumentationStepAction, options, + {params: {reason, data, callFrames}}) { + const scriptId = callFrames[0].functionLocation.scriptId; + InspectorTest.log(`Paused with reason ${reason}, data ${ + data ? JSON.stringify(data) : '{}'} and scriptId: ${scriptId}.`); + + if (reason === 'instrumentation') { + Protocol.Debugger.resume(); + } else { + Protocol.Debugger[noInstrumentationStepAction](options); + } } +const resumeOnPause = handlePause.bind(null, 'resume', null); + async function setUpEnvironment() { await Protocol.Debugger.enable(); await Protocol.Runtime.enable(); @@ -53,17 +63,6 @@ InspectorTest.runAsyncTestSuite([ await setUpEnvironment(); await Protocol.Debugger.setInstrumentationBreakpoint( {instrumentation: 'beforeScriptExecution'}); - const stepOnPause = (({params: {reason, data}}) => { - InspectorTest.log(`Paused with reason: ${reason} and data: ${ - data ? JSON.stringify(data) : '{}'}.`); - if (reason === 'instrumentation') { - Protocol.Debugger.resume(); - } else { - Protocol.Debugger.stepInto(); - } - }); - Protocol.Debugger.onPaused(stepOnPause); - const {result: {scriptId}} = await Protocol.Runtime.compileScript({ expression: `setTimeout('console.log(3);//# sourceURL=bar.js', 0);`, sourceURL: 'foo.js', @@ -74,7 +73,17 @@ InspectorTest.runAsyncTestSuite([ url: 'foo.js', }); - await Protocol.Runtime.runScript({scriptId}); + const runPromise = Protocol.Runtime.runScript({scriptId}); + // Pausing 5 times: + // 2x instrumentation breaks, + // 1x breakpoint, + // 2x step ins: end of setTimeout function, start of inner script. + for (var i = 0; i < 5; ++i) { + const msg = await Protocol.Debugger.oncePaused(); + handlePause('stepInto', null, msg); + } + + await runPromise; await tearDownEnvironment(); }, async function testOnlyReportOtherWithEmptyDataOnce() { @@ -110,17 +119,41 @@ InspectorTest.runAsyncTestSuite([ await setUpEnvironment(); await Protocol.Debugger.setInstrumentationBreakpoint( {instrumentation: 'beforeScriptExecution'}); - const stepOnPause = (({params: {reason, data}}) => { - InspectorTest.log(`Paused with reason: ${reason} and data: ${ - data ? JSON.stringify(data) : '{}'}.`); - Protocol.Debugger.stepInto({breakOnAsyncCall: true}); - }); - Protocol.Debugger.onPaused(stepOnPause); const expression = `debugger; setTimeout('console.log(3);//# sourceURL=bar.js', 0);`; const {result: {scriptId}} = await Protocol.Runtime.compileScript( {expression, sourceURL: 'foo.js', persistScript: true}); - await Protocol.Runtime.runScript({scriptId}); + const runPromise = Protocol.Runtime.runScript({scriptId}); + // Pausing 6 times: + // 2x instrumentation breaks, + // 1x debugger statement, + // 3x steps in: start of setTimeout, start of inner script, end of inner script. + for (var i = 0; i < 6; ++i) { + const msg = await Protocol.Debugger.oncePaused(); + handlePause('stepInto', {breakOnAsyncCall: true}, msg); + } + await runPromise; + await tearDownEnvironment(); + }, + async function testSteppingOutPauseReason() { + await setUpEnvironment(); + await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}); + const expression = ` + function test() { + debugger; + eval('console.log(3);//# sourceURL=bar.js'); + } + test(); + ` + const {result: {scriptId}} = await Protocol.Runtime.compileScript( + {expression, sourceURL: 'foo.js', persistScript: true}); + + const runPromise = Protocol.Runtime.runScript({scriptId}); + const stepOutOnPause = handlePause.bind(this, 'stepOut', null); + Protocol.Debugger.onPaused(stepOutOnPause); + + await runPromise; await tearDownEnvironment(); }, ]); diff --git a/deps/v8/test/inspector/debugger/pause-at-negative-offset.js b/deps/v8/test/inspector/debugger/pause-at-negative-offset.js index 4d0928b2ec..a709b48eea 100644 --- a/deps/v8/test/inspector/debugger/pause-at-negative-offset.js +++ b/deps/v8/test/inspector/debugger/pause-at-negative-offset.js @@ -8,7 +8,7 @@ let {session, contextGroup, Protocol} = (async function test() { session.setupScriptMap(); await Protocol.Debugger.enable(); - contextGroup.addScript(`debugger;//# sourceURL=test.js`, -3, -3); + contextGroup.addScript(`debugger;`, -3, -3, 'test.js'); let {params:{callFrames}} = await Protocol.Debugger.oncePaused(); session.logCallFrames(callFrames); InspectorTest.completeTest(); diff --git a/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized-expected.txt b/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized-expected.txt index af9afabce4..2f2791e7e5 100644 --- a/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized-expected.txt +++ b/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized-expected.txt @@ -1,4 +1,6 @@ Checks pause inside blackboxed optimized function call. + +Running test: test bar (test.js:2:4) foo (framework.js:2:15) (anonymous) (expr.js:1:12) diff --git a/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized.js b/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized.js index 36f523d8ad..2d66f08300 100644 --- a/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized.js +++ b/deps/v8/test/inspector/debugger/pause-inside-blackboxed-optimized.js @@ -26,7 +26,9 @@ contextGroup.addScript(` //# sourceURL=test.js `); -(async function test(){ +session.setupScriptMap(); + +InspectorTest.runAsyncTestSuite([async function test() { Protocol.Debugger.enable(); Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); Protocol.Runtime.evaluate({expression: ` @@ -35,5 +37,4 @@ contextGroup.addScript(` `}); const {params:{callFrames}} = await Protocol.Debugger.oncePaused(); session.logCallFrames(callFrames); - InspectorTest.completeTest(); -})(); +}]); diff --git a/deps/v8/test/inspector/debugger/resource-name-to-url-expected.txt b/deps/v8/test/inspector/debugger/resource-name-to-url-expected.txt index 9e26f2bdd4..c0be81b257 100644 --- a/deps/v8/test/inspector/debugger/resource-name-to-url-expected.txt +++ b/deps/v8/test/inspector/debugger/resource-name-to-url-expected.txt @@ -124,7 +124,7 @@ Test runtime stack trace: } Test debugger stack trace: [ - [0] : prefix://url - [1] : boo.js - [2] : prefix://url + [0] : + [1] : + [2] : ] diff --git a/deps/v8/test/inspector/debugger/set-breakpoint-after-gc-expected.txt b/deps/v8/test/inspector/debugger/set-breakpoint-after-gc-expected.txt index 773f69990e..512ae69fcb 100644 --- a/deps/v8/test/inspector/debugger/set-breakpoint-after-gc-expected.txt +++ b/deps/v8/test/inspector/debugger/set-breakpoint-after-gc-expected.txt @@ -1,5 +1,5 @@ Checks if we keep alive breakpoint information for top-level functions. Result of setting breakpoint in topLevel.js -[{"scriptId":"3","lineNumber":0,"columnNumber":0}] +[] Result of setting breakpoint in moduleFunc.js -[{"scriptId":"5","lineNumber":0,"columnNumber":22}]
\ No newline at end of file +[{"scriptId":"5","lineNumber":0,"columnNumber":22}] diff --git a/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation-expected.txt b/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation-expected.txt new file mode 100644 index 0000000000..bade1a9791 --- /dev/null +++ b/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation-expected.txt @@ -0,0 +1,26 @@ +Test if breakpoints are hit that are set on instrumentation pause in js + +Running test: testSetBreakpointOnInstrumentationPause +set breakpoint and evaluate script.. +Setting breakpoint at instrumentation break location +Paused at foo.js with reason "instrumentation". +Hit breakpoints: [] +Paused at foo.js with reason "other". +Hit breakpoints: ["4:0:20:3"] +Done. + +Running test: testSetConditionalBreakpointTrueConditionOnInstrumentationPause +set breakpoint and evaluate script.. +Setting breakpoint at instrumentation break location +Paused at foo.js with reason "instrumentation". +Hit breakpoints: [] +Paused at foo.js with reason "other". +Hit breakpoints: ["4:0:20:4"] +Done. + +Running test: testSetConditionalBreakpointFalseConditionOnInstrumentationPause +set breakpoint and evaluate script.. +Setting breakpoint at instrumentation break location +Paused at foo.js with reason "instrumentation". +Hit breakpoints: [] +Done. diff --git a/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation.js b/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation.js new file mode 100644 index 0000000000..41f885a06e --- /dev/null +++ b/deps/v8/test/inspector/debugger/set-breakpoint-on-instrumentation.js @@ -0,0 +1,87 @@ +// Copyright 2022 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +const {session, contextGroup, Protocol} = InspectorTest.start( + 'Test if breakpoints are hit that are set on instrumentation pause in js'); + +session.setupScriptMap(); +function setBreakpoint(msg, condition) { + const reason = msg.params.reason; + if (reason === 'instrumentation') { + const top_frame = msg.params.callFrames[0]; + const scriptId = top_frame.location.scriptId; + const columnNumber = top_frame.location.columnNumber; + + InspectorTest.log('Setting breakpoint at instrumentation break location'); + const breakpoint_info = { + 'location': {scriptId, 'lineNumber': 0, columnNumber} + }; + if (condition) { + breakpoint_info.condition = condition; + } + return Protocol.Debugger.setBreakpoint(breakpoint_info); + } + return Promise.resolve(); +} + +function handlePause(msg) { + const top_frame = msg.params.callFrames[0]; + const reason = msg.params.reason; + const url = session.getCallFrameUrl(top_frame); + InspectorTest.log(`Paused at ${url} with reason "${reason}".`); + InspectorTest.log( + `Hit breakpoints: ${JSON.stringify(msg.params.hitBreakpoints)}`) + return Protocol.Debugger.resume(); +}; + +// Helper function to check if we can successfully set and evaluate breakpoints +// on an instrumentation pause. +async function runSetBreakpointOnInstrumentationTest(condition) { + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + + InspectorTest.log('set breakpoint and evaluate script..'); + await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}); + const runPromise = + Protocol.Runtime.evaluate({expression: '//# sourceURL=foo.js'}); + + // First pause: instrumentation + const msg = await Protocol.Debugger.oncePaused(); + await setBreakpoint(msg, condition); + await handlePause(msg); + + // Second pause: if condition evaluates to true + if (!condition || eval(condition)) { + await handlePause(await Protocol.Debugger.oncePaused()); + } + + InspectorTest.log('Done.'); + await runPromise; + await Protocol.Runtime.disable(); + await Protocol.Debugger.disable(); +} + +InspectorTest.runAsyncTestSuite([ + // Test if we can set a breakpoint on the first breakable location (which is + // the same location as where the instrumentation breakpoint hits) and + // successfully hit the breakpoint. + async function testSetBreakpointOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest(); + }, + + // Test if we can set a conditional breakpoint on the first breakable location + // and successfully hit the breakpoint. + async function + testSetConditionalBreakpointTrueConditionOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest('4 > 3'); + }, + + // Test if we can set a conditional breakpoint on the first breakable location + // which evaluates to false, and therefore does not trigger a pause. + async function + testSetConditionalBreakpointFalseConditionOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest('3 > 4'); + } +]); diff --git a/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint-expected.txt b/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint-expected.txt index 94f58aacd1..c0fb6f18a4 100644 --- a/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint-expected.txt +++ b/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint-expected.txt @@ -87,3 +87,40 @@ paused with reason: instrumentation sourceMapURL : boo.js url : foo.js } + +Running test: testRemoveAfterCompile +set breakpoint.. +compile script.. +Remove instrumentation breakpoint.. +evaluate script.. +no breakpoint was hit + +Running test: testRemoveBeforeEvaluate +set breakpoint.. +Remove instrumentation breakpoint.. +evaluate script.. +no breakpoint was hit + +Running test: testRemoveAfterOnePause +set breakpoint.. +evaluate script.. +paused with reason: instrumentation +{ + scriptId : <scriptId> + url : foo.js +} +Remove instrumentation breakpoint.. +evaluate another script.. +no breakpoint was hit + +Running test: testInstrumentationCoincideWithScheduledPauseOnNextStatement +set breakpoint.. +set instrumentation +paused with reason: instrumentation +{ + scriptId : <scriptId> + url : +} +paused with reason: instrumentation:scriptFirstStatement +{ +} diff --git a/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint.js b/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint.js index 3c52bdf16d..c5939bdab0 100644 --- a/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint.js +++ b/deps/v8/test/inspector/debugger/set-instrumentation-breakpoint.js @@ -127,5 +127,100 @@ InspectorTest.runAsyncTestSuite([ } await Protocol.Debugger.disable(); await Protocol.Runtime.disable(); + }, + + async function testRemoveAfterCompile() { + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('set breakpoint..'); + const { result : {breakpointId} } = await Protocol.Debugger.setInstrumentationBreakpoint({ + instrumentation: 'beforeScriptExecution' + }); + InspectorTest.log('compile script..'); + const { result: { scriptId } } = await Protocol.Runtime.compileScript({ + expression: 'console.log(3)', sourceURL: 'foo.js', persistScript: true }); + + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint({breakpointId}); + + InspectorTest.log('evaluate script..'); + await Protocol.Runtime.runScript({ scriptId }); + InspectorTest.log('no breakpoint was hit'); + + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testRemoveBeforeEvaluate() { + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('set breakpoint..'); + const { result : {breakpointId} } = await Protocol.Debugger.setInstrumentationBreakpoint({ + instrumentation: 'beforeScriptExecution' + }); + + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint({breakpointId}); + + InspectorTest.log('evaluate script..'); + await Protocol.Runtime.evaluate({expression: 'console.log(3) //# sourceURL=foo.js'}); + InspectorTest.log('no breakpoint was hit'); + + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testRemoveAfterOnePause() { + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('set breakpoint..'); + const { result : {breakpointId} } = await Protocol.Debugger.setInstrumentationBreakpoint({ + instrumentation: 'beforeScriptExecution' + }); + + InspectorTest.log('evaluate script..'); + Protocol.Runtime.evaluate({expression: 'console.log(3) //# sourceURL=foo.js'}); + { + const { params: { reason, data } } = await Protocol.Debugger.oncePaused(); + InspectorTest.log(`paused with reason: ${reason}`); + InspectorTest.logMessage(data); + } + + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint({breakpointId}); + + InspectorTest.log('evaluate another script..'); + await Protocol.Runtime.evaluate({expression: 'console.log(3) //# sourceURL=foo.js'}); + InspectorTest.log('no breakpoint was hit'); + + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testInstrumentationCoincideWithScheduledPauseOnNextStatement() { + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('set breakpoint..'); + InspectorTest.log('set instrumentation'); + await Protocol.Debugger.setInstrumentationBreakpoint({ + instrumentation: 'beforeScriptExecution' + }); + contextGroup.schedulePauseOnNextStatement('instrumentation:scriptFirstStatement', '{}'); + const runPromise = Protocol.Runtime.evaluate({expression: 'console.log(3)'}); + { + const { params: { reason, data } } = await Protocol.Debugger.oncePaused(); + InspectorTest.log(`paused with reason: ${reason}`); + InspectorTest.logMessage(data); + Protocol.Debugger.resume(); + } + { + const { params: { reason, data } } = await Protocol.Debugger.oncePaused(); + InspectorTest.log(`paused with reason: ${reason}`); + InspectorTest.logMessage(data); + Protocol.Debugger.resume(); + } + await runPromise; + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); } ]); diff --git a/deps/v8/test/inspector/debugger/step-into-break-on-async-call.js b/deps/v8/test/inspector/debugger/step-into-break-on-async-call.js index 417f4a3936..b859d03924 100644 --- a/deps/v8/test/inspector/debugger/step-into-break-on-async-call.js +++ b/deps/v8/test/inspector/debugger/step-into-break-on-async-call.js @@ -5,6 +5,8 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Test for Debugger.stepInto with breakOnAsyncCall.'); +session.setupScriptMap(); + InspectorTest.runAsyncTestSuite([ async function testSetTimeout() { Protocol.Debugger.enable(); diff --git a/deps/v8/test/inspector/debugger/step-into-external-async-task-expected.txt b/deps/v8/test/inspector/debugger/step-into-external-async-task-expected.txt index ce82054f06..b2e7e3e86b 100644 --- a/deps/v8/test/inspector/debugger/step-into-external-async-task-expected.txt +++ b/deps/v8/test/inspector/debugger/step-into-external-async-task-expected.txt @@ -1,4 +1,6 @@ Test for step-into remote async task + +Running test: test Setup debugger agents.. Pause before stack trace is captured.. Run stepInto with breakOnAsyncCall flag diff --git a/deps/v8/test/inspector/debugger/step-into-external-async-task.js b/deps/v8/test/inspector/debugger/step-into-external-async-task.js index 59b78c1630..30ef3bc321 100644 --- a/deps/v8/test/inspector/debugger/step-into-external-async-task.js +++ b/deps/v8/test/inspector/debugger/step-into-external-async-task.js @@ -1,6 +1,8 @@ // Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// +// Flags: --no-compilation-cache InspectorTest.log('Test for step-into remote async task'); @@ -18,11 +20,8 @@ function store(description) { } //# sourceURL=utils.js`; -// TODO(rmcilroy): This has to be in this order since the i::Script object gets -// reused via the CompilationCache, and we want OnAfterCompile to be called -// for contextGroup1 last on this script. -contextGroup2.addScript(utilsScript); contextGroup1.addScript(utilsScript); +contextGroup2.addScript(utilsScript); let frameworkScript = ` function call(id, f) { @@ -38,7 +37,7 @@ contextGroup2.addScript(frameworkScript); session1.setupScriptMap(); session2.setupScriptMap(); -(async function test() { +InspectorTest.runAsyncTestSuite([async function test() { InspectorTest.log('Setup debugger agents..'); let debuggerId1 = (await Protocol1.Debugger.enable()).result.debuggerId; let debuggerId2 = (await Protocol2.Debugger.enable()).result.debuggerId; @@ -77,7 +76,7 @@ session2.setupScriptMap(); let debuggers = new Map( [[debuggerId1, Protocol1.Debugger], [debuggerId2, Protocol2.Debugger]]); let sessions = new Map([[debuggerId1, session1], [debuggerId2, session2]]); - let currentDebuggerId = debuggerId1; + let currentDebuggerId = debuggerId2; while (true) { sessions.get(currentDebuggerId).logCallFrames(callFrames); if (asyncStackTraceId) { @@ -98,6 +97,4 @@ session2.setupScriptMap(); Protocol2.Debugger.setAsyncCallStackDepth({maxDepth: 0}); await Protocol1.Debugger.disable(); await Protocol2.Debugger.disable(); - - InspectorTest.completeTest(); -})() +}]); diff --git a/deps/v8/test/inspector/debugger/step-into-next-script-expected.txt b/deps/v8/test/inspector/debugger/step-into-next-script-expected.txt index b0e34cceec..1e1a7e73ed 100644 --- a/deps/v8/test/inspector/debugger/step-into-next-script-expected.txt +++ b/deps/v8/test/inspector/debugger/step-into-next-script-expected.txt @@ -8,7 +8,7 @@ test (foo.js:12:2) (anonymous) (timeout1.js:0:8) -foo (timeout2.js:2:2) +foo (timeout2.js:19:2) (anonymous) (timeout3.js:0:8) @@ -28,9 +28,9 @@ test (foo.js:13:0) (anonymous) (timeout1.js:0:35) -foo (timeout2.js:2:2) +foo (timeout2.js:19:2) -foo (timeout2.js:2:12) +foo (timeout2.js:19:12) (anonymous) (timeout3.js:0:8) @@ -61,9 +61,9 @@ test (foo.js:13:0) (anonymous) (timeout1.js:0:35) -foo (timeout2.js:2:2) +foo (timeout2.js:19:2) -foo (timeout2.js:2:12) +foo (timeout2.js:19:12) (anonymous) (timeout3.js:0:8) diff --git a/deps/v8/test/inspector/debugger/step-into-next-script.js b/deps/v8/test/inspector/debugger/step-into-next-script.js index 80e9a9180f..7624536444 100644 --- a/deps/v8/test/inspector/debugger/step-into-next-script.js +++ b/deps/v8/test/inspector/debugger/step-into-next-script.js @@ -4,20 +4,22 @@ let {session, contextGroup, Protocol} = InspectorTest.start('Debugger breaks in next script after stepOut from previous one.'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function test() { setTimeout('var a = 1;//# sourceURL=timeout1.js', 0); setTimeout(foo, 0); setTimeout('var a = 3;//# sourceURL=timeout3.js', 0); debugger; -} -//# sourceURL=foo.js`, 7, 26); +}`, + 'foo.js'); -contextGroup.addScript(` +contextGroup.addInlineScript( + ` function foo() { return 42; -} -//# sourceURL=timeout2.js`) +}`, + 'timeout2.js'); session.setupScriptMap(); var stepAction; diff --git a/deps/v8/test/inspector/debugger/step-out-async-await-expected.txt b/deps/v8/test/inspector/debugger/step-out-async-await-expected.txt index 83efd83046..2294d1df57 100644 --- a/deps/v8/test/inspector/debugger/step-out-async-await-expected.txt +++ b/deps/v8/test/inspector/debugger/step-out-async-await-expected.txt @@ -1,6 +1,6 @@ StepOut from return position of async function. -Running test: testStepInto +Running test: testStepIntoAtReturnPosition p.then(() => 1); #debugger; return p; @@ -13,12 +13,12 @@ Running test: testStepInto return p;# } - await p; - p.then(() => #1); - debugger; + await foo(); + #} -Running test: testStepOver + +Running test: testStepOverAtReturnPosition p.then(() => 1); #debugger; return p; @@ -31,20 +31,12 @@ Running test: testStepOver return p;# } - await p; - p.then(() => #1); - debugger; - - await p; - p.then(() => 1#); - debugger; - await foo(); #} -Running test: testStepOut +Running test: testStepOutAtReturnPosition p.then(() => 1); #debugger; return p; @@ -57,9 +49,15 @@ Running test: testStepOut return p;# } - await p; - p.then(() => #1); - debugger; + await foo(); + #} + + + +Running test: testStepOut + p.then(() => 1); + #debugger; + return p; await foo(); #} diff --git a/deps/v8/test/inspector/debugger/step-out-async-await.js b/deps/v8/test/inspector/debugger/step-out-async-await.js index 4164aa2871..1fd8a98eff 100644 --- a/deps/v8/test/inspector/debugger/step-out-async-await.js +++ b/deps/v8/test/inspector/debugger/step-out-async-await.js @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(kozyatinskiy): on StepOut and probably StepOver at return position -// of async generator we should break at next instruction of resumed generator -// instead of next scheduled microtask. - let {session, contextGroup, Protocol} = InspectorTest.start('StepOut from return position of async function.'); contextGroup.addScript(` @@ -22,48 +18,90 @@ contextGroup.addScript(` `); session.setupScriptMap(); -Protocol.Debugger.enable(); + InspectorTest.runAsyncTestSuite([ - async function testStepInto() { - Protocol.Runtime.evaluate({expression: 'testFunction()'}); + async function testStepIntoAtReturnPosition() { + await Promise.all([ + Protocol.Runtime.enable(), + Protocol.Debugger.enable(), + ]); + const evalPromise = + Protocol.Runtime.evaluate({expression: 'testFunction()'}); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.resume(); + await Promise.all([ + Protocol.Debugger.resume(), + evalPromise, + Protocol.Debugger.disable(), + Protocol.Runtime.disable(), + ]); }, - async function testStepOver() { - Protocol.Runtime.evaluate({expression: 'testFunction()'}); - await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + async function testStepOverAtReturnPosition() { + await Promise.all([ + Protocol.Runtime.enable(), + Protocol.Debugger.enable(), + ]); + const evalPromise = + Protocol.Runtime.evaluate({expression: 'testFunction()'}); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepOver(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepOver(); + await Protocol.Debugger.stepOver(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepOver(); - await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.resume(); + await Promise.all([ + Protocol.Debugger.resume(), + evalPromise, + Protocol.Debugger.disable(), + Protocol.Runtime.disable(), + ]); }, - async function testStepOut() { - Protocol.Runtime.evaluate({expression: 'testFunction()'}); + async function testStepOutAtReturnPosition() { + await Promise.all([ + Protocol.Runtime.enable(), + Protocol.Debugger.enable(), + ]); + const evalPromise = + Protocol.Runtime.evaluate({expression: 'testFunction()'}); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepInto(); + await Protocol.Debugger.stepInto(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepOut(); + await Protocol.Debugger.stepOut(); + await logPauseLocation(await Protocol.Debugger.oncePaused()); + await Promise.all([ + Protocol.Debugger.resume(), + evalPromise, + Protocol.Debugger.disable(), + Protocol.Runtime.disable(), + ]); + }, + + async function testStepOut() { + await Promise.all([ + Protocol.Runtime.enable(), + Protocol.Debugger.enable(), + ]); + const evalPromise = + Protocol.Runtime.evaluate({expression: 'testFunction()'}); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.stepOut(); + await Protocol.Debugger.stepOut(); await logPauseLocation(await Protocol.Debugger.oncePaused()); - Protocol.Debugger.resume(); + await Promise.all([ + Protocol.Debugger.resume(), + evalPromise, + Protocol.Debugger.disable(), + Protocol.Runtime.disable(), + ]); }, ]); diff --git a/deps/v8/test/inspector/debugger/wasm-externref-global.js b/deps/v8/test/inspector/debugger/wasm-externref-global.js index 8daa70033e..5c8ff40b0e 100644 --- a/deps/v8/test/inspector/debugger/wasm-externref-global.js +++ b/deps/v8/test/inspector/debugger/wasm-externref-global.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --experimental-wasm-reftypes - utils.load('test/inspector/wasm-inspector-test.js'); let {session, contextGroup, Protocol} = diff --git a/deps/v8/test/inspector/debugger/wasm-gc-breakpoints-expected.txt b/deps/v8/test/inspector/debugger/wasm-gc-breakpoints-expected.txt index df1078822d..ea687a1716 100644 --- a/deps/v8/test/inspector/debugger/wasm-gc-breakpoints-expected.txt +++ b/deps/v8/test/inspector/debugger/wasm-gc-breakpoints-expected.txt @@ -3,12 +3,12 @@ Tests GC object inspection. Running test: test Instantiating. Waiting for wasm script (ignoring first non-wasm script). -Setting breakpoint at offset 107 on script wasm://wasm/151aafd6 +Setting breakpoint at offset 109 on script wasm://wasm/b18cf04a Calling main() Paused: -Script wasm://wasm/151aafd6 byte offset 107: Wasm opcode 0x21 (kExprLocalSet) +Script wasm://wasm/b18cf04a byte offset 109: Wasm opcode 0x21 (kExprLocalSet) Scope: -at $main (0:107): +at $main (0:109): - scope (wasm-expression-stack): 0: Array ((ref $ArrC)) object details: diff --git a/deps/v8/test/inspector/debugger/wasm-gc-breakpoints.js b/deps/v8/test/inspector/debugger/wasm-gc-breakpoints.js index 4306e20ec5..724e86080a 100644 --- a/deps/v8/test/inspector/debugger/wasm-gc-breakpoints.js +++ b/deps/v8/test/inspector/debugger/wasm-gc-breakpoints.js @@ -14,8 +14,10 @@ const module_bytes = [ 0x00, 0x61, 0x73, 0x6d, 1, 0, 0, 0, // wasm magic 0x01, // type section - 0x16, // section length - 0x04, // number of types + 0x18, // section length + 0x01, // number of type section entries + 0x4f, // recursive type group + 0x04, // number of types in the recursive group // type 0: struct $StrA (field ($byte i8) ($word i16) ($pointer (ref $StrB))) 0x5f, // struct 0x03, // field count @@ -172,7 +174,7 @@ Protocol.Debugger.onPaused(async msg => { var lineNumber = frame.location.lineNumber; var columnNumber = frame.location.columnNumber; InspectorTest.log(`at ${functionName} (${lineNumber}:${columnNumber}):`); - if (!/^wasm/.test(frame.url)) { + if (!/^wasm/.test(session.getCallFrameUrl(frame))) { InspectorTest.log(' -- skipped'); continue; } @@ -219,7 +221,7 @@ InspectorTest.runAsyncTestSuite([ // Ignore javascript and full module wasm script, get scripts for functions. const [, {params: wasm_script}] = await Protocol.Debugger.onceScriptParsed(2); - let offset = 107; // "local.set $varC" at the end. + let offset = 109; // "local.set $varC" at the end. await setBreakpoint(offset, wasm_script.scriptId, wasm_script.url); InspectorTest.log('Calling main()'); await WasmInspectorTest.evalWithUrl('instance.exports.main()', 'runWasm'); diff --git a/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break-expected.txt b/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break-expected.txt index 2d1669e3f6..bb3a01e096 100644 --- a/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break-expected.txt +++ b/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break-expected.txt @@ -4,7 +4,7 @@ Running test: test Script wasm://wasm/38e28046 byte offset 51: Wasm opcode 0x20 (kExprLocalGet) GC triggered Debugger.resume -Hello World (v8://test/instantiate:11:36) +log: Hello World (v8://test/instantiate:11:36) at bar (v8://test/instantiate:11:36) at $wasm_A (wasm://wasm/38e28046:1:54) at test (test.js:4:20) diff --git a/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break.js b/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break.js index 90680a7b4a..9f8c252870 100644 --- a/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break.js +++ b/deps/v8/test/inspector/debugger/wasm-gc-in-debug-break.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --experimental-wasm-reftypes --expose-gc +// Flags: --expose-gc utils.load('test/inspector/wasm-inspector-test.js'); let {session, contextGroup, Protocol} = diff --git a/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint-expected.txt b/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint-expected.txt index 01d4b3018a..ebb627ae4d 100644 --- a/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint-expected.txt +++ b/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint-expected.txt @@ -82,3 +82,69 @@ Paused at wasm://wasm/c8e3a856 with reason "instrumentation". Script wasm://wasm/c8e3a856 byte offset 33: Wasm opcode 0x01 (kExprNop) Hit breakpoints: [] Done. + +Running test: testRemoveBeforeCompile +Setting instrumentation breakpoint +{ + id : <messageId> + result : { + breakpointId : <breakpointId> + } +} +Remove instrumentation breakpoint.. +Compiling wasm module. +Instantiating module should not trigger a break. +Done. + +Running test: testRemoveBeforeInstantiate +Setting instrumentation breakpoint +{ + id : <messageId> + result : { + breakpointId : <breakpointId> + } +} +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Remove instrumentation breakpoint.. +Instantiating module should not trigger a break. +Done. + +Running test: testRemoveAfterOnePause +Setting instrumentation breakpoint +{ + id : <messageId> + result : { + breakpointId : <breakpointId> + } +} +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Instantiating module should trigger a break. +Paused at v8://test/instantiate with reason "instrumentation". +Hit breakpoints: [] +Paused at wasm://wasm/20da547a with reason "instrumentation". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: [] +Remove instrumentation breakpoint.. +Compiling another wasm module. +Instantiating module should not trigger a break. +Done. + +Running test: testDisableEnable +Setting instrumentation breakpoint +{ + id : <messageId> + result : { + breakpointId : <breakpointId> + } +} +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Disable debugger.. +Enable debugger +Instantiating module should not trigger a break. +Done. diff --git a/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint.js b/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint.js index 35b528f250..8eca2fd304 100644 --- a/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint.js +++ b/deps/v8/test/inspector/debugger/wasm-instrumentation-breakpoint.js @@ -12,8 +12,9 @@ Protocol.Debugger.onPaused(async msg => { let top_frame = msg.params.callFrames[0]; let reason = msg.params.reason; let hitBreakpoints = msg.params.hitBreakpoints; - InspectorTest.log(`Paused at ${top_frame.url} with reason "${reason}".`); - if (!top_frame.url.startsWith('v8://test/')) { + const url = session.getCallFrameUrl(top_frame); + InspectorTest.log(`Paused at ${url} with reason "${reason}".`); + if (!url.startsWith('v8://test/')) { await session.logSourceLocation(top_frame.location); } // Report the hit breakpoints to make sure that it is empty, as @@ -74,8 +75,7 @@ InspectorTest.runAsyncTestSuite([ async function testBreakInExportedFunction() { const builder = new WasmModuleBuilder(); - const func = - builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc(); + builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc(); await Protocol.Runtime.enable(); await Protocol.Debugger.enable(); @@ -99,8 +99,7 @@ InspectorTest.runAsyncTestSuite([ async function testBreakOnlyWithSourceMap() { const builder = new WasmModuleBuilder(); - const func = - builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc(); + builder.addFunction('func', kSig_v_v).addBody([kExprNop]).exportFunc(); const bytes_no_source_map = builder.toArray(); builder.addCustomSection('sourceMappingURL', [3, 97, 98, 99]); const bytes_with_source_map = builder.toArray(); @@ -129,4 +128,108 @@ InspectorTest.runAsyncTestSuite([ await Protocol.Runtime.disable(); }, + async function testRemoveBeforeCompile() { + const builder = new WasmModuleBuilder(); + const start_fn = builder.addFunction('start', kSig_v_v).addBody([kExprNop]); + builder.addStart(start_fn.index); + + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('Setting instrumentation breakpoint'); + const addMsg = await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}) + InspectorTest.logMessage(addMsg); + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint( + {breakpointId: addMsg.result.breakpointId}); + InspectorTest.log('Compiling wasm module.'); + await WasmInspectorTest.compile(builder.toArray()); + InspectorTest.log('Instantiating module should not trigger a break.'); + await WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + InspectorTest.log('Done.'); + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testRemoveBeforeInstantiate() { + const builder = new WasmModuleBuilder(); + const start_fn = builder.addFunction('start', kSig_v_v).addBody([kExprNop]); + builder.addStart(start_fn.index); + + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('Setting instrumentation breakpoint'); + const addMsg = await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}) + InspectorTest.logMessage(addMsg); + InspectorTest.log('Compiling wasm module.'); + await WasmInspectorTest.compile(builder.toArray()); + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint( + {breakpointId: addMsg.result.breakpointId}); + InspectorTest.log('Instantiating module should not trigger a break.'); + await WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + InspectorTest.log('Done.'); + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testRemoveAfterOnePause() { + const builder = new WasmModuleBuilder(); + const start_fn = builder.addFunction('start', kSig_v_v).addBody([kExprNop]); + builder.addStart(start_fn.index); + + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('Setting instrumentation breakpoint'); + const addMsg = await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}) + InspectorTest.logMessage(addMsg); + InspectorTest.log('Compiling wasm module.'); + await WasmInspectorTest.compile(builder.toArray()); + InspectorTest.log('Instantiating module should trigger a break.'); + await WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + InspectorTest.log('Remove instrumentation breakpoint..'); + await Protocol.Debugger.removeBreakpoint( + {breakpointId: addMsg.result.breakpointId}); + + InspectorTest.log('Compiling another wasm module.'); + builder.addFunction('end', kSig_v_v).addBody([kExprNop]); + await WasmInspectorTest.compile(builder.toArray()); + InspectorTest.log('Instantiating module should not trigger a break.'); + await WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + InspectorTest.log('Done.'); + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + + async function testDisableEnable() { + const builder = new WasmModuleBuilder(); + const start_fn = builder.addFunction('start', kSig_v_v).addBody([kExprNop]); + builder.addStart(start_fn.index); + + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('Setting instrumentation breakpoint'); + const addMsg = await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}) + InspectorTest.logMessage(addMsg); + InspectorTest.log('Compiling wasm module.'); + await WasmInspectorTest.compile(builder.toArray()); + InspectorTest.log('Disable debugger..'); + await Protocol.Debugger.disable(); + InspectorTest.log('Enable debugger'); + await Protocol.Debugger.enable(); + InspectorTest.log('Instantiating module should not trigger a break.'); + await WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + InspectorTest.log('Done.'); + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); + }, + ]); diff --git a/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation-expected.txt b/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation-expected.txt new file mode 100644 index 0000000000..6aaa1a05b5 --- /dev/null +++ b/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation-expected.txt @@ -0,0 +1,49 @@ +Test if breakpoints are hit that are set on instrumentation pause in wasm. + +Running test: testSetBreakpointOnInstrumentationPause +Setting instrumentation breakpoint +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Instantiating module. +Paused at v8://test/instantiate with reason "instrumentation". +Hit breakpoints: [] +Setting breakpoint at instrumentation break location +Paused at wasm://wasm/20da547a with reason "instrumentation". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: [] +Paused at wasm://wasm/20da547a with reason "other". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: ["4:0:26:4"] +Done. + +Running test: testSetConditionalBreakpointTrueConditionOnInstrumentationPause +Setting instrumentation breakpoint +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Instantiating module. +Paused at v8://test/instantiate with reason "instrumentation". +Hit breakpoints: [] +Setting breakpoint at instrumentation break location +Paused at wasm://wasm/20da547a with reason "instrumentation". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: [] +Paused at wasm://wasm/20da547a with reason "other". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: ["4:0:26:4"] +Done. + +Running test: testSetConditionalBreakpointFalseConditionOnInstrumentationPause +Setting instrumentation breakpoint +Compiling wasm module. +Paused at v8://test/compile_module with reason "instrumentation". +Hit breakpoints: [] +Instantiating module. +Paused at v8://test/instantiate with reason "instrumentation". +Hit breakpoints: [] +Setting breakpoint at instrumentation break location +Paused at wasm://wasm/20da547a with reason "instrumentation". +Script wasm://wasm/20da547a byte offset 26: Wasm opcode 0x01 (kExprNop) +Hit breakpoints: [] +Done. diff --git a/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation.js b/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation.js new file mode 100644 index 0000000000..c8a4f582ae --- /dev/null +++ b/deps/v8/test/inspector/debugger/wasm-set-breakpoint-on-instrumentation.js @@ -0,0 +1,106 @@ +// Copyright 2022 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +utils.load('test/inspector/wasm-inspector-test.js'); + +const {session, contextGroup, Protocol} = InspectorTest.start( + 'Test if breakpoints are hit that are set on instrumentation pause in wasm.'); +session.setupScriptMap(); + +function setBreakpoint(msg, condition) { + const top_frame = msg.params.callFrames[0]; + const reason = msg.params.reason; + const url = session.getCallFrameUrl(top_frame); + if (reason === 'instrumentation' && url.startsWith('wasm://')) { + const scriptId = top_frame.location.scriptId; + const columnNumber = top_frame.location.columnNumber; + + InspectorTest.log('Setting breakpoint at instrumentation break location'); + const breakpoint_info = { + 'location': {scriptId, 'lineNumber': 0, columnNumber} + }; + if (condition) { + breakpoint_info.condition = condition; + } + return Protocol.Debugger.setBreakpoint(breakpoint_info); + } + return Promise.resolve(); +} + +async function handlePause(msg) { + const top_frame = msg.params.callFrames[0]; + const reason = msg.params.reason; + const url = session.getCallFrameUrl(top_frame); + InspectorTest.log(`Paused at ${url} with reason "${reason}".`); + if (!url.startsWith('v8://test/')) { + await session.logSourceLocation(top_frame.location); + } + InspectorTest.log( + `Hit breakpoints: ${JSON.stringify(msg.params.hitBreakpoints)}`) + return Protocol.Debugger.resume(); +}; + +// Helper function to run tests to check if we can successfully set and evaluate +// breakpoints on an instrumentation pause. +async function runSetBreakpointOnInstrumentationTest(condition) { + const builder = new WasmModuleBuilder(); + const start_fn = builder.addFunction('start', kSig_v_v).addBody([kExprNop]); + builder.addStart(start_fn.index); + + await Protocol.Runtime.enable(); + await Protocol.Debugger.enable(); + InspectorTest.log('Setting instrumentation breakpoint'); + await Protocol.Debugger.setInstrumentationBreakpoint( + {instrumentation: 'beforeScriptExecution'}); + InspectorTest.log('Compiling wasm module.'); + WasmInspectorTest.compile(builder.toArray()); + + // First pause: compile script. + await handlePause(await Protocol.Debugger.oncePaused()); + + InspectorTest.log('Instantiating module.'); + const evalPromise = WasmInspectorTest.evalWithUrl( + 'new WebAssembly.Instance(module)', 'instantiate'); + + // Second pause: instantiate script. + await handlePause(await Protocol.Debugger.oncePaused()); + + // Third pause: wasm script. This will set a breakpoint. Pass on a condition. + const msg = await Protocol.Debugger.oncePaused(); + await setBreakpoint(msg, condition); + await handlePause(msg); + + // Fourth pause: wasm script, if condition evaluates to true. + if (!condition || eval(condition)) { + await handlePause(await Protocol.Debugger.oncePaused()); + } + + InspectorTest.log('Done.'); + await evalPromise; + await Protocol.Debugger.disable(); + await Protocol.Runtime.disable(); +} + +InspectorTest.runAsyncTestSuite([ + // Test if we can set a breakpoint on the first breakable location (which is + // the same location as where the instrumentation breakpoint hits) and + // successfully hit the breakpoint. + async function testSetBreakpointOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest(); + }, + + // Test if we can set a conditional breakpoint on the first breakable location + // and successfully hit the breakpoint. + async function + testSetConditionalBreakpointTrueConditionOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest('3 < 5'); + }, + + // Test if we can set a conditional breakpoint on the first breakable location + // which evaluates to false, and therefore does not trigger a pause. + async function + testSetConditionalBreakpointFalseConditionOnInstrumentationPause() { + await runSetBreakpointOnInstrumentationTest('3 > 5'); + }, +]); diff --git a/deps/v8/test/inspector/debugger/wasm-set-breakpoint.js b/deps/v8/test/inspector/debugger/wasm-set-breakpoint.js index a5bc8b333e..7f5bd096d9 100644 --- a/deps/v8/test/inspector/debugger/wasm-set-breakpoint.js +++ b/deps/v8/test/inspector/debugger/wasm-set-breakpoint.js @@ -58,7 +58,8 @@ Protocol.Debugger.onPaused(async msg => { var lineNumber = frame.location.lineNumber; var columnNumber = frame.location.columnNumber; InspectorTest.log(`at ${functionName} (${lineNumber}:${columnNumber}):`); - if (!/^wasm/.test(frame.url)) { + var url = session.getCallFrameUrl(frame); + if (!/^wasm/.test(url)) { InspectorTest.log(' -- skipped'); continue; } @@ -73,10 +74,10 @@ Protocol.Debugger.onPaused(async msg => { if (first_iteration && loc.columnNumber == func_a.body_offset) { // Check that setting breakpoints on active instances of A and B takes // effect immediately. - setBreakpoint(func_a.body_offset + 1, loc.scriptId, frame.url); + setBreakpoint(func_a.body_offset + 1, loc.scriptId, url); // All of the following breakpoints are in reachable code, except offset 17. for (offset of [18, 17, 11, 10, 8, 6, 2, 4]) { - setBreakpoint(func_b.body_offset + offset, loc.scriptId, frame.url); + setBreakpoint(func_b.body_offset + offset, loc.scriptId, url); } first_iteration = false; } diff --git a/deps/v8/test/inspector/debugger/wasm-step-after-trap.js b/deps/v8/test/inspector/debugger/wasm-step-after-trap.js index 182b2a16b9..9244bee77b 100644 --- a/deps/v8/test/inspector/debugger/wasm-step-after-trap.js +++ b/deps/v8/test/inspector/debugger/wasm-step-after-trap.js @@ -34,7 +34,8 @@ Protocol.Debugger.onPaused(async msg => { for (let [nr, frame] of msg.params.callFrames.entries()) { InspectorTest.log(`--- ${nr} ---`); await session.logSourceLocation(frame.location); - if (/^wasm/.test(frame.url)) await printLocalScope(frame); + if (/^wasm/.test(session.getCallFrameUrl(frame))) + await printLocalScope(frame); } InspectorTest.log('-------------'); let action = actions.shift(); |