diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc index f65b590b04..a65cc738e3 100644 --- a/src/inspector/v8-debugger.cc +++ b/src/inspector/v8-debugger.cc @@ -683,12 +683,15 @@ void V8Debugger::PromiseEventOccurred(v8::debug::PromiseDebugActionType type, } std::shared_ptr V8Debugger::currentAsyncParent() { + // TODO(kozyatinskiy): implement creation chain as parent without hack. + if (!m_currentAsyncCreation.empty() && m_currentAsyncCreation.back()) { + return m_currentAsyncCreation.back(); + } return m_currentAsyncParent.empty() ? nullptr : m_currentAsyncParent.back(); } std::shared_ptr V8Debugger::currentAsyncCreation() { - return m_currentAsyncCreation.empty() ? nullptr - : m_currentAsyncCreation.back(); + return nullptr; } void V8Debugger::compileDebuggerScript() { @@ -856,7 +859,8 @@ void V8Debugger::asyncTaskCreatedForStack(void* task, void* parentTask) { if (parentTask) m_parentTask[task] = parentTask; v8::HandleScope scope(m_isolate); std::shared_ptr asyncCreation = - AsyncStackTrace::capture(this, currentContextGroupId(), String16(), 1); + AsyncStackTrace::capture(this, currentContextGroupId(), String16(), + V8StackTraceImpl::maxCallStackSizeToCapture); // Passing one as maxStackSize forces no async chain for the new stack. if (asyncCreation && !asyncCreation->isEmpty()) { m_asyncTaskCreationStacks[task] = asyncCreation; @@ -932,6 +936,12 @@ void V8Debugger::asyncTaskStartedForStack(void* task) { auto itCreation = m_asyncTaskCreationStacks.find(task); if (itCreation != m_asyncTaskCreationStacks.end()) { m_currentAsyncCreation.push_back(itCreation->second.lock()); + // TODO(kozyatinskiy): implement it without hack. + if (m_currentAsyncParent.back()) { + m_currentAsyncCreation.back()->setDescription( + m_currentAsyncParent.back()->description()); + m_currentAsyncParent.back().reset(); + } } else { m_currentAsyncCreation.emplace_back(); } diff --git a/src/inspector/v8-stack-trace-impl.cc b/src/inspector/v8-stack-trace-impl.cc index cb509bd8e9..a2a4ce1b6e 100644 --- a/src/inspector/v8-stack-trace-impl.cc +++ b/src/inspector/v8-stack-trace-impl.cc @@ -298,14 +298,9 @@ AsyncStackTrace::AsyncStackTrace( std::unique_ptr AsyncStackTrace::buildInspectorObject(AsyncStackTrace* asyncCreation, int maxAsyncDepth) const { - std::unique_ptr stackTrace = - buildInspectorObjectCommon(m_frames, m_description, m_asyncParent.lock(), - m_asyncCreation.lock(), maxAsyncDepth); - if (asyncCreation && !asyncCreation->isEmpty()) { - stackTrace->setPromiseCreationFrame( - asyncCreation->m_frames[0]->buildInspectorObject()); - } - return stackTrace; + return buildInspectorObjectCommon(m_frames, m_description, + m_asyncParent.lock(), + m_asyncCreation.lock(), maxAsyncDepth); } int AsyncStackTrace::contextGroupId() const { return m_contextGroupId; } diff --git a/src/inspector/v8-stack-trace-impl.h b/src/inspector/v8-stack-trace-impl.h index 302f6fbbb9..867eb81de0 100644 --- a/src/inspector/v8-stack-trace-impl.h +++ b/src/inspector/v8-stack-trace-impl.h @@ -102,6 +102,11 @@ class AsyncStackTrace { std::weak_ptr creation() const; bool isEmpty() const; + void setDescription(const String16& description) { + // TODO(kozyatinskiy): implement it without hack. + m_description = description; + } + private: AsyncStackTrace(int contextGroupId, const String16& description, std::vector> frames, diff --git a/test/inspector/debugger/async-for-await-of-promise-stack-expected.txt b/test/inspector/debugger/async-for-await-of-promise-stack-expected.txt index fb1403917a..0cfa3c4349 100644 --- a/test/inspector/debugger/async-for-await-of-promise-stack-expected.txt +++ b/test/inspector/debugger/async-for-await-of-promise-stack-expected.txt @@ -1,57 +1,58 @@ Checks that async chains for for-await-of are correct. Running test: testBasic -Debugger (test.js:10:2) -Basic (test.js:48:4) --- async function (test.js:46:20)-- -Basic (test.js:46:20) +Debugger (test.js:12:2) +Basic (test.js:50:4) +-- async function -- +Basic (test.js:48:20) (anonymous) (testBasic.js:0:0) Running test: testUncaughtReject -Debugger (test.js:10:2) --- async function (test.js:52:29)-- -UncaughtReject (test.js:52:29) +Debugger (test.js:12:2) +-- async function -- +UncaughtReject (test.js:54:29) (anonymous) (testUncaughtReject.js:0:0) Running test: testUncaughtThrow -Debugger (test.js:10:2) --- async function (test.js:61:28)-- -UncaughtThrow (test.js:61:28) +Debugger (test.js:12:2) +-- async function -- +UncaughtThrow (test.js:63:28) (anonymous) (testUncaughtThrow.js:0:0) Running test: testCaughtReject -Debugger (test.js:10:2) -CaughtReject (test.js:76:4) --- async function (test.js:70:27)-- -CaughtReject (test.js:70:27) +Debugger (test.js:12:2) +CaughtReject (test.js:78:4) +-- async function -- +CaughtReject (test.js:72:27) (anonymous) (testCaughtReject.js:0:0) Running test: testCaughtThrow -Debugger (test.js:10:2) -CaughtThrow (test.js:86:4) --- async function (test.js:80:26)-- -CaughtThrow (test.js:80:26) +Debugger (test.js:12:2) +CaughtThrow (test.js:88:4) +-- async function -- +CaughtThrow (test.js:82:26) (anonymous) (testCaughtThrow.js:0:0) Running test: testUncaughtRejectOnBreak Running test: testUncaughtThrowOnBreak -Debugger (test.js:10:2) --- async function (test.js:99:35)-- -UncaughtThrowOnBreak (test.js:99:35) +Debugger (test.js:12:2) +-- async function -- +UncaughtThrowOnBreak (test.js:101:35) (anonymous) (testUncaughtThrowOnBreak.js:0:0) Running test: testCaughtRejectOnBreak Running test: testCaughtThrowOnBreak -Debugger (test.js:10:2) -CaughtThrowOnBreak (test.js:124:4) --- async function (test.js:118:33)-- -CaughtThrowOnBreak (test.js:118:33) -(anonymous) (testCaughtThrowOnBreak.js:0:0) \ No newline at end of file +Debugger (test.js:12:2) +CaughtThrowOnBreak (test.js:126:4) +-- async function -- +CaughtThrowOnBreak (test.js:120:33) +(anonymous) (testCaughtThrowOnBreak.js:0:0) + diff --git a/test/inspector/debugger/async-for-await-of-promise-stack.js b/test/inspector/debugger/async-for-await-of-promise-stack.js index 4e6c0bf15e..2ed886f18e 100644 --- a/test/inspector/debugger/async-for-await-of-promise-stack.js +++ b/test/inspector/debugger/async-for-await-of-promise-stack.js @@ -50,7 +50,7 @@ async function Basic() { Debugger(); } } - +// TODO(kozyatinskiy): this stack trace is suspicious. async function UncaughtReject() { async function loop() { for await (let x of [Reject(new Error("boop"))]) { @@ -59,7 +59,7 @@ async function UncaughtReject() { } return loop().catch(Debugger); } - +// TODO(kozyatinskiy): this stack trace is suspicious. async function UncaughtThrow() { async function loop() { for await (let x of [Throw(new Error("boop"))]) { @@ -88,7 +88,7 @@ async function CaughtThrow() { Debugger(e); } } - +// TODO(kozyatinskiy): this stack trace is suspicious. async function UncaughtRejectOnBreak() { async function loop() { for await (let x of RejectOnReturn(["0", "1"])) { @@ -97,7 +97,7 @@ async function UncaughtRejectOnBreak() { } return loop().catch(Debugger); } - +// TODO(kozyatinskiy): this stack trace is suspicious. async function UncaughtThrowOnBreak() { async function loop() { for await (let x of ThrowOnReturn(["0", "1"])) { @@ -106,7 +106,7 @@ async function UncaughtThrowOnBreak() { } return loop().catch(Debugger); } - +// TODO(kozyatinskiy): this stack trace is suspicious. async function CaughtRejectOnBreak() { try { for await (let x of RejectOnReturn(["0", "1"])) { @@ -126,7 +126,7 @@ async function CaughtThrowOnBreak() { Debugger(e); } } -//# sourceURL=test.js`, 7, 129); +//# sourceURL=test.js`, 9, 26); InspectorTest.setupScriptMap(); Protocol.Debugger.onPaused(message => { diff --git a/test/inspector/debugger/async-instrumentation-expected.txt b/test/inspector/debugger/async-instrumentation-expected.txt index 2a538879ae..3b9f58aefc 100644 --- a/test/inspector/debugger/async-instrumentation-expected.txt +++ b/test/inspector/debugger/async-instrumentation-expected.txt @@ -9,12 +9,12 @@ test (test.js:21:2) foo (test.js:10:2) -- Promise.resolve -- -test (test.js:20:2) +test (test.js:19:14) (anonymous) (expr1.js:0:0) foo (test.js:12:2) -- Promise.resolve -- -test (test.js:20:2) +test (test.js:19:14) (anonymous) (expr1.js:0:0) diff --git a/test/inspector/debugger/async-promise-late-then-expected.txt b/test/inspector/debugger/async-promise-late-then-expected.txt index ee91377178..dfdf81fe8c 100644 --- a/test/inspector/debugger/async-promise-late-then-expected.txt +++ b/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.resolve -- -test (test.js:20:2) +test (test.js:18:14) (anonymous) (expr.js:0:0) foo1 (test.js:11:2) -- Promise.resolve -- -test (test.js:20:2) +test (test.js:22:14) (anonymous) (expr.js:0:0) foo1 (test.js:11:2) -- Promise.resolve -- -test (test.js:20:2) +test (test.js:24:14) (anonymous) (expr.js:0:0) diff --git a/test/inspector/debugger/async-stack-await-expected.txt b/test/inspector/debugger/async-stack-await-expected.txt index 506b9a268a..4ebcefadad 100644 --- a/test/inspector/debugger/async-stack-await-expected.txt +++ b/test/inspector/debugger/async-stack-await-expected.txt @@ -1,34 +1,33 @@ Checks that async stacks works for async/await foo2 (test.js:15:2) --- async function (test.js:13:19)-- +-- async function -- foo2 (test.js:13:19) test (test.js:24:8) (anonymous) (expr.js:0:0) foo2 (test.js:17:2) --- async function (test.js:13:19)-- +-- async function -- foo2 (test.js:13:19) test (test.js:24:8) (anonymous) (expr.js:0:0) foo1 (test.js:9:2) foo2 (test.js:18:8) --- async function (test.js:13:19)-- +-- async function -- foo2 (test.js:13:19) test (test.js:24:8) (anonymous) (expr.js:0:0) foo1 (test.js:9:2) --- Promise.resolve (test.js:19:43)-- --- Promise.resolve (test.js:19:16)-- -foo2 (test.js:19:30) --- async function (test.js:13:19)-- +-- Promise.resolve -- +foo2 (test.js:19:43) +-- async function -- foo2 (test.js:13:19) test (test.js:24:8) (anonymous) (expr.js:0:0) foo2 (test.js:20:2) --- async function (test.js:13:19)-- +-- async function -- foo2 (test.js:13:19) test (test.js:24:8) (anonymous) (expr.js:0:0) diff --git a/test/inspector/debugger/async-stack-created-frame-expected.txt b/test/inspector/debugger/async-stack-created-frame-expected.txt index 6e61d1aca4..f5197a1669 100644 --- a/test/inspector/debugger/async-stack-created-frame-expected.txt +++ b/test/inspector/debugger/async-stack-created-frame-expected.txt @@ -2,88 +2,79 @@ Checks created frame for async call chain Running test: testPromise foo1 (test.js:10:2) --- Promise.resolve (test.js:20:14)-- -promise (test.js:21:2) +-- Promise.resolve -- +promise (test.js:20:14) (anonymous) (expr.js:0:0) Running test: testPromiseThen foo1 (test.js:10:2) --- Promise.resolve (test.js:28:14)-- -promiseThen (test.js:30:2) +-- Promise.resolve -- +promiseThen (test.js:28:14) (anonymous) (expr.js:0:0) foo2 (test.js:14:2) --- Promise.resolve (test.js:29:14)-- --- Promise.resolve (test.js:28:14)-- -promiseThen (test.js:30:2) +-- Promise.resolve -- +promiseThen (test.js:29:14) (anonymous) (expr.js:0:0) Running test: testPromiseThenThen foo1 (test.js:10:2) --- Promise.resolve (test.js:37:14)-- -promiseThenThen (test.js:39:2) +-- Promise.resolve -- +promiseThenThen (test.js:37:14) (anonymous) (expr.js:0:0) foo1 (test.js:10:2) --- Promise.resolve (test.js:38:14)-- -promiseThenThen (test.js:39:2) +-- Promise.resolve -- +promiseThenThen (test.js:38:14) (anonymous) (expr.js:0:0) foo2 (test.js:14:2) --- Promise.resolve (test.js:37:25)-- --- Promise.resolve (test.js:37:14)-- -promiseThenThen (test.js:39:2) +-- Promise.resolve -- +promiseThenThen (test.js:37:25) (anonymous) (expr.js:0:0) Running test: testPromiseResolve foo1 (test.js:10:2) --- Promise.resolve (test.js:44:27)-- -promiseResolve (test.js:44:17) +-- Promise.resolve -- +promiseResolve (test.js:44:27) (anonymous) (expr.js:0:0) Running test: testPromiseReject foo1 (test.js:10:2) --- Promise.reject (test.js:48:31)-- -promiseReject (test.js:48:17) +-- Promise.reject -- +promiseReject (test.js:48:31) (anonymous) (expr.js:0:0) Running test: testPromiseAll foo1 (test.js:10:2) --- Promise.resolve (test.js:52:44)-- --- Promise.resolve (test.js:52:17)-- -promiseAll (test.js:52:31) +-- Promise.resolve -- +promiseAll (test.js:52:44) (anonymous) (expr.js:0:0) Running test: testPromiseRace foo1 (test.js:10:2) --- Promise.resolve (test.js:56:45)-- --- Promise.resolve (test.js:56:17)-- -promiseRace (test.js:56:32) +-- Promise.resolve -- +promiseRace (test.js:56:45) (anonymous) (expr.js:0:0) Running test: testThenableJob1 foo1 (test.js:10:2) --- Promise.resolve (test.js:60:72)-- --- Promise.resolve (test.js:60:56)-- -Promise.resolve.then (test.js:60:46) --- Promise.resolve (test.js:60:27)-- -thenableJob1 (test.js:60:17) +-- Promise.resolve -- +thenableJob1 (test.js:60:72) (anonymous) (expr.js:0:0) Running test: testThenableJob2 foo1 (test.js:10:2) --- Promise.resolve (test.js:64:57)-- -Promise.resolve.then (test.js:64:46) --- Promise.resolve (test.js:64:27)-- -thenableJob2 (test.js:64:17) +-- Promise.resolve -- +thenableJob2 (test.js:64:57) (anonymous) (expr.js:0:0) diff --git a/test/inspector/debugger/async-stack-created-frame.js b/test/inspector/debugger/async-stack-created-frame.js index f73591dc29..c6e01e3bdb 100644 --- a/test/inspector/debugger/async-stack-created-frame.js +++ b/test/inspector/debugger/async-stack-created-frame.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(kozyatinskiy): fix this test. InspectorTest.log('Checks created frame for async call chain'); InspectorTest.addScript( diff --git a/test/inspector/debugger/async-stack-for-promise-expected.txt b/test/inspector/debugger/async-stack-for-promise-expected.txt index a948803f28..81640849ec 100644 --- a/test/inspector/debugger/async-stack-for-promise-expected.txt +++ b/test/inspector/debugger/async-stack-for-promise-expected.txt @@ -2,173 +2,118 @@ Checks that async chains for promises are correct. Running test: testPromise foo1 (test.js:9:2) --- Promise.resolve (test.js:19:14)-- -promise (test.js:20:2) +-- Promise.resolve -- +promise (test.js:19:14) (anonymous) (testPromise.js:0:0) Running test: testPromiseResolvedBySetTimeout foo1 (test.js:9:2) --- Promise.resolve (test.js:27:14)-- --- setTimeout -- -promiseResolvedBySetTimeout (test.js:28:2) +-- Promise.resolve -- +promiseResolvedBySetTimeout (test.js:27:14) (anonymous) (testPromiseResolvedBySetTimeout.js:0:0) Running test: testPromiseAll foo1 (test.js:9:2) --- Promise.resolve (test.js:37:35)-- --- Promise.resolve (test.js:37:19)-- -promiseAll (test.js:39:2) +-- Promise.resolve -- +promiseAll (test.js:37:35) (anonymous) (testPromiseAll.js:0:0) Running test: testPromiseAllReverseOrder foo1 (test.js:9:2) --- Promise.resolve (test.js:48:35)-- --- Promise.resolve (test.js:48:19)-- -promiseAllReverseOrder (test.js:50:2) +-- Promise.resolve -- +promiseAllReverseOrder (test.js:48:35) (anonymous) (testPromiseAllReverseOrder.js:0:0) Running test: testPromiseRace foo1 (test.js:9:2) --- Promise.resolve (test.js:59:36)-- --- Promise.resolve (test.js:59:19)-- -promiseRace (test.js:60:2) +-- Promise.resolve -- +promiseRace (test.js:59:36) (anonymous) (testPromiseRace.js:0:0) Running test: testTwoChainedCallbacks foo1 (test.js:9:2) --- Promise.resolve (test.js:68:14)-- -twoChainedCallbacks (test.js:69:2) +-- Promise.resolve -- +twoChainedCallbacks (test.js:68:14) (anonymous) (testTwoChainedCallbacks.js:0:0) foo2 (test.js:13:2) --- Promise.resolve (test.js:68:25)-- --- Promise.resolve (test.js:68:14)-- -twoChainedCallbacks (test.js:69:2) +-- Promise.resolve -- +twoChainedCallbacks (test.js:68:25) (anonymous) (testTwoChainedCallbacks.js:0:0) Running test: testPromiseResolve foo1 (test.js:9:2) --- Promise.resolve (test.js:74:27)-- -promiseResolve (test.js:74:17) +-- Promise.resolve -- +promiseResolve (test.js:74:27) (anonymous) (testPromiseResolve.js:0:0) foo2 (test.js:13:2) --- Promise.resolve (test.js:74:38)-- --- Promise.resolve (test.js:74:27)-- -promiseResolve (test.js:74:17) +-- Promise.resolve -- +promiseResolve (test.js:74:38) (anonymous) (testPromiseResolve.js:0:0) Running test: testThenableJobResolvedInSetTimeout foo1 (test.js:9:2) --- Promise.resolve (test.js:86:40)-- --- setTimeout -- -thenableJob (test.js:81:4) -p1.then (test.js:86:25) --- Promise.resolve (test.js:86:14)-- -thenableJobResolvedInSetTimeout (test.js:87:2) +-- Promise.resolve -- +thenableJobResolvedInSetTimeout (test.js:86:40) (anonymous) (testThenableJobResolvedInSetTimeout.js:0:0) Running test: testThenableJobResolvedInSetTimeoutWithStack foo1 (test.js:9:2) --- Promise.resolve (test.js:104:40)-- -inner (test.js:94:6) --- setTimeout -- -thenableJob (test.js:99:4) -p1.then (test.js:104:25) --- Promise.resolve (test.js:104:14)-- -thenableJobResolvedInSetTimeoutWithStack (test.js:105:2) +-- Promise.resolve -- +thenableJobResolvedInSetTimeoutWithStack (test.js:104:40) (anonymous) (testThenableJobResolvedInSetTimeoutWithStack.js:0:0) Running test: testThenableJobResolvedByPromise foo1 (test.js:9:2) --- Promise.resolve (test.js:118:40)-- --- Promise.resolve (test.js:113:22)-- -thenableJob (test.js:113:12) -p1.then (test.js:118:25) --- Promise.resolve (test.js:118:14)-- -thenableJobResolvedByPromise (test.js:119:2) +-- Promise.resolve -- +thenableJobResolvedByPromise (test.js:118:40) (anonymous) (testThenableJobResolvedByPromise.js:0:0) Running test: testThenableJobResolvedByPromiseWithStack foo1 (test.js:9:2) --- Promise.resolve (test.js:136:40)-- -inner (test.js:126:6) --- Promise.resolve (test.js:131:22)-- -thenableJob (test.js:131:12) -p1.then (test.js:136:25) --- Promise.resolve (test.js:136:14)-- -thenableJobResolvedByPromiseWithStack (test.js:137:2) +-- Promise.resolve -- +thenableJobResolvedByPromiseWithStack (test.js:136:40) (anonymous) (testThenableJobResolvedByPromiseWithStack.js:0:0) Running test: testLateThenCallback foo1 (test.js:9:2) --- Promise.resolve (test.js:145:12)-- -lateThenCallback (test.js:144:2) +-- Promise.resolve -- +lateThenCallback (test.js:145:12) (anonymous) (testLateThenCallback.js:0:0) Running test: testComplex inner1 (test.js:154:6) foo1 (test.js:156:4) --- Promise.resolve (test.js:202:5)-- -inner2 (test.js:162:6) --- Promise.resolve (test.js:165:22)-- -foo2 (test.js:165:12) --- Promise.resolve (test.js:201:5)-- -inner3 (test.js:172:6) --- setTimeout -- -foo3 (test.js:175:4) --- Promise.resolve (test.js:200:5)-- --- Promise.resolve (test.js:199:5)-- --- Promise.resolve (test.js:188:7)-- --- Promise.resolve (test.js:187:19)-- -foo5 (test.js:187:52) --- Promise.resolve (test.js:198:5)-- --- Promise.resolve (test.js:193:7)-- --- Promise.resolve (test.js:192:19)-- -foo6 (test.js:192:34) --- Promise.resolve (test.js:197:5)-- -complex (test.js:196:18) +-- Promise.resolve -- +complex (test.js:202:5) (anonymous) (testComplex.js:0:0) p.then (test.js:207:8) --- Promise.resolve (test.js:206:8)-- --- Promise.resolve (test.js:202:5)-- -inner2 (test.js:162:6) --- Promise.resolve (test.js:165:22)-- -foo2 (test.js:165:12) --- Promise.resolve (test.js:201:5)-- -inner3 (test.js:172:6) +-- Promise.resolve -- +p.then (test.js:206:8) +-- Promise.resolve -- +setTimeout (test.js:205:6) -- setTimeout -- -foo3 (test.js:175:4) --- Promise.resolve (test.js:200:5)-- --- Promise.resolve (test.js:199:5)-- --- Promise.resolve (test.js:188:7)-- --- Promise.resolve (test.js:187:19)-- -foo5 (test.js:187:52) --- Promise.resolve (test.js:198:5)-- --- Promise.resolve (test.js:193:7)-- --- Promise.resolve (test.js:192:19)-- -foo6 (test.js:192:34) --- Promise.resolve (test.js:197:5)-- -complex (test.js:196:18) +complex (test.js:204:2) (anonymous) (testComplex.js:0:0) Running test: testReject foo1 (test.js:9:2) --- Promise.reject (test.js:217:31)-- -reject (test.js:217:17) +-- Promise.reject -- +reject (test.js:217:31) (anonymous) (testReject.js:0:0) diff --git a/test/inspector/debugger/collect-old-async-call-chains-expected.txt b/test/inspector/debugger/collect-old-async-call-chains-expected.txt index e3a8842fde..64fef4af77 100644 --- a/test/inspector/debugger/collect-old-async-call-chains-expected.txt +++ b/test/inspector/debugger/collect-old-async-call-chains-expected.txt @@ -7,11 +7,11 @@ actual async chain len: 1 inspector.setMaxAsyncTaskStacks(1024) Run expression 'console.trace(42)' with async chain len: 2 -actual async chain len: 2 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(1024) Run expression 'console.trace(42)' with async chain len: 5 -actual async chain len: 5 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(1024) Run expression 'console.trace(42)' with async chain len: 1 @@ -47,11 +47,11 @@ actual async chain len: 0 Running test: testOneLimit inspector.setMaxAsyncTaskStacks(1) Run expression 'console.trace(42)' with async chain len: 1 -actual async chain len: 0 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(1) Run expression 'console.trace(42)' with async chain len: 2 -actual async chain len: 0 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(1) Run expression 'console.trace(42)' with async chain len: 1 @@ -65,7 +65,7 @@ actual async chain len: 1 Running test: testTwoLimit inspector.setMaxAsyncTaskStacks(2) Run expression 'console.trace(42)' with async chain len: 1 -actual async chain len: 0 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(2) Run expression 'console.trace(42)' with async chain len: 2 @@ -73,7 +73,7 @@ actual async chain len: 0 inspector.setMaxAsyncTaskStacks(2) Run expression 'console.trace(42)' with async chain len: 3 -actual async chain len: 0 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(2) Run expression 'console.trace(42)' with async chain len: 1 @@ -99,7 +99,7 @@ actual async chain len: 1 inspector.setMaxAsyncTaskStacks(3) Run expression 'console.trace(42)' with async chain len: 3 -actual async chain len: 0 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(3) Run expression 'console.trace(42)' with async chain len: 1 @@ -143,11 +143,11 @@ actual async chain len: 1 inspector.setMaxAsyncTaskStacks(5) Run expression 'console.trace(42)' with async chain len: 2 -actual async chain len: 2 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(5) Run expression 'console.trace(42)' with async chain len: 3 -actual async chain len: 2 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(5) Run expression 'console.trace(42)' with async chain len: 1 @@ -167,7 +167,7 @@ actual async chain len: 1 inspector.setMaxAsyncTaskStacks(6) Run expression 'console.trace(42)' with async chain len: 2 -actual async chain len: 2 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(6) Run expression 'console.trace(42)' with async chain len: 3 @@ -191,11 +191,11 @@ actual async chain len: 1 inspector.setMaxAsyncTaskStacks(7) Run expression 'console.trace(42)' with async chain len: 2 -actual async chain len: 2 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(7) Run expression 'console.trace(42)' with async chain len: 3 -actual async chain len: 3 +actual async chain len: 1 inspector.setMaxAsyncTaskStacks(7) Run expression 'console.trace(42)' with async chain len: 1 diff --git a/test/inspector/debugger/max-async-call-chain-depth-expected.txt b/test/inspector/debugger/max-async-call-chain-depth-expected.txt index 9256c3bb94..0c421da607 100644 --- a/test/inspector/debugger/max-async-call-chain-depth-expected.txt +++ b/test/inspector/debugger/max-async-call-chain-depth-expected.txt @@ -3,23 +3,23 @@ set async chain depth to 8 Running test: testDebuggerPaused Run expression 'debugger;' with async chain len: 4 -actual async chain len: 4 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 8 -actual async chain len: 8 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 9 -actual async chain len: 8 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 32 -actual async chain len: 8 +actual async chain len: 1 Running test: testConsoleTrace Run expression 'console.trace(42);' with async chain len: 4 -actual async chain len: 4 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 8 -actual async chain len: 8 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 9 -actual async chain len: 8 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 32 -actual async chain len: 8 +actual async chain len: 1 Running test: testDebuggerPausedSetTimeout Run expression 'debugger;' with async chain len: 4 @@ -54,56 +54,37 @@ Running test: testConsoleTraceWithEmptySync ] parent : { callFrames : [ + [0] : { + columnNumber : 47 + functionName : + lineNumber : 0 + scriptId : + url : + } ] description : Promise.resolve - parent : { - callFrames : [ - [0] : { - columnNumber : 23 - functionName : resolve - lineNumber : 0 - scriptId : - url : - } - [1] : { - columnNumber : 0 - functionName : - lineNumber : 0 - scriptId : - url : - } - ] - description : setTimeout - } - promiseCreationFrame : { - columnNumber : 47 - functionName : - lineNumber : 0 - scriptId : - url : - } } } Running test: testDebuggerPausedThenableJob Run expression 'debugger;' with async chain len: 4 -actual async chain len: 4 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 8 -actual async chain len: 8 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 9 -actual async chain len: 8 +actual async chain len: 1 Run expression 'debugger;' with async chain len: 32 -actual async chain len: 8 +actual async chain len: 1 Running test: testConsoleTraceThenableJob Run expression 'console.trace(42);' with async chain len: 4 -actual async chain len: 4 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 8 -actual async chain len: 8 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 9 -actual async chain len: 8 +actual async chain len: 1 Run expression 'console.trace(42);' with async chain len: 32 -actual async chain len: 8 +actual async chain len: 1 Running test: twoConsoleAssert actual async chain len: 1 diff --git a/test/inspector/debugger/max-async-call-chain-depth.js b/test/inspector/debugger/max-async-call-chain-depth.js index 772e9e68e8..bf6d2d31af 100644 --- a/test/inspector/debugger/max-async-call-chain-depth.js +++ b/test/inspector/debugger/max-async-call-chain-depth.js @@ -1,7 +1,7 @@ // 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. - +// TODO(kozyatinskiy): fix or remove it later. InspectorTest.log('Checks that we trim async call chains correctly.'); Protocol.Debugger.enable(); diff --git a/test/inspector/debugger/promise-chain-when-limit-hit-expected.txt b/test/inspector/debugger/promise-chain-when-limit-hit-expected.txt index 1b63dea525..283c913e2e 100644 --- a/test/inspector/debugger/promise-chain-when-limit-hit-expected.txt +++ b/test/inspector/debugger/promise-chain-when-limit-hit-expected.txt @@ -21,6 +21,17 @@ Run expression 'console.trace()' with async chain len: 3 url : } ] + parent : { + callFrames : [ + [0] : { + columnNumber : 46 + functionName : + lineNumber : 0 + scriptId : + url : + } + ] + } } timestamp : type : trace @@ -50,15 +61,15 @@ Run expression 'console.trace()' with async chain len: 3 ] parent : { callFrames : [ + [0] : { + columnNumber : 46 + functionName : + lineNumber : 0 + scriptId : + url : + } ] description : Promise.resolve - promiseCreationFrame : { - columnNumber : 46 - functionName : - lineNumber : 0 - scriptId : - url : - } } } timestamp : @@ -89,27 +100,15 @@ Run expression 'console.trace()' with async chain len: 3 ] parent : { callFrames : [ - ] - description : Promise.resolve - parent : { - callFrames : [ - ] - description : Promise.resolve - promiseCreationFrame : { - columnNumber : 32 + [0] : { + columnNumber : 46 functionName : lineNumber : 0 scriptId : url : } - } - promiseCreationFrame : { - columnNumber : 46 - functionName : - lineNumber : 0 - scriptId : - url : - } + ] + description : Promise.resolve } } timestamp : @@ -140,15 +139,15 @@ Run expression 'console.trace()' with async chain len: 3 ] parent : { callFrames : [ + [0] : { + columnNumber : 46 + functionName : + lineNumber : 0 + scriptId : + url : + } ] description : Promise.resolve - promiseCreationFrame : { - columnNumber : 46 - functionName : - lineNumber : 0 - scriptId : - url : - } } } timestamp : @@ -179,46 +178,15 @@ Run expression 'console.trace()' with async chain len: 3 ] parent : { callFrames : [ - ] - description : Promise.resolve - parent : { - callFrames : [ - ] - description : Promise.resolve - parent : { - callFrames : [ - [0] : { - columnNumber : 8 - functionName : - lineNumber : 0 - scriptId : - url : - } - ] - description : Promise.resolve - promiseCreationFrame : { - columnNumber : 18 - functionName : - lineNumber : 0 - scriptId : - url : - } - } - promiseCreationFrame : { - columnNumber : 32 + [0] : { + columnNumber : 46 functionName : lineNumber : 0 scriptId : url : } - } - promiseCreationFrame : { - columnNumber : 46 - functionName : - lineNumber : 0 - scriptId : - url : - } + ] + description : Promise.resolve } } timestamp : @@ -249,46 +217,15 @@ Run expression 'console.trace()' with async chain len: 3 ] parent : { callFrames : [ - ] - description : Promise.resolve - parent : { - callFrames : [ - ] - description : Promise.resolve - parent : { - callFrames : [ - [0] : { - columnNumber : 8 - functionName : - lineNumber : 0 - scriptId : - url : - } - ] - description : Promise.resolve - promiseCreationFrame : { - columnNumber : 18 - functionName : - lineNumber : 0 - scriptId : - url : - } - } - promiseCreationFrame : { - columnNumber : 32 + [0] : { + columnNumber : 46 functionName : lineNumber : 0 scriptId : url : } - } - promiseCreationFrame : { - columnNumber : 46 - functionName : - lineNumber : 0 - scriptId : - url : - } + ] + description : Promise.resolve } } timestamp : diff --git a/test/inspector/debugger/promise-chain-when-limit-hit.js b/test/inspector/debugger/promise-chain-when-limit-hit.js index 53ff71780c..6e57adb204 100644 --- a/test/inspector/debugger/promise-chain-when-limit-hit.js +++ b/test/inspector/debugger/promise-chain-when-limit-hit.js @@ -1,7 +1,7 @@ // 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. - +// TODO(kozyatinskiy): fix or remove it later. (async function test(){ InspectorTest.log('Checks correctness of promise chains when limit hit'); await Protocol.Runtime.enable(); diff --git a/test/inspector/debugger/set-async-call-stack-depth-expected.txt b/test/inspector/debugger/set-async-call-stack-depth-expected.txt index 25c1327ca5..98fccebe68 100644 --- a/test/inspector/debugger/set-async-call-stack-depth-expected.txt +++ b/test/inspector/debugger/set-async-call-stack-depth-expected.txt @@ -3,15 +3,15 @@ Checks that we report not more then maxDepth call chains. Running test: testPaused Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 16 -reported: 8 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 8 -reported: 8 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 7 -reported: 7 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 0 @@ -21,15 +21,15 @@ reported: 0 Running test: testConsoleTrace Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 16 -reported: 8 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 8 -reported: 8 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 7 -reported: 7 +reported: 1 Actual call chain length: 8 setAsyncCallStackDepth(maxDepth): 0 diff --git a/test/inspector/debugger/set-async-call-stack-depth.js b/test/inspector/debugger/set-async-call-stack-depth.js index 444c10591a..a9c6f1ce50 100644 --- a/test/inspector/debugger/set-async-call-stack-depth.js +++ b/test/inspector/debugger/set-async-call-stack-depth.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(kozyatinskiy): fix or remove it later with new stack traces it's almost +// imposible to hit limit. InspectorTest.log('Checks that we report not more then maxDepth call chains.'); InspectorTest.addScript(`