Commit f61facfd authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] use creation stack trace as parent for async call chains

Creation stack trace points to the place where callback was actually chained, scheduled points where parent promise was resolved.
For async tasks without creation stack (e.g. setTimeout) we continue to use scheduled as creation since usually they are the same.

BUG=v8:6189
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2868493002
Cr-Original-Commit-Position: refs/heads/master@{#45198}
Committed: https://chromium.googlesource.com/v8/v8/+/e118462f18a862df81a04486e13dd62997cbfc5a
Review-Url: https://codereview.chromium.org/2868493002
Cr-Commit-Position: refs/heads/master@{#45266}
parent 28f3bf1a
......@@ -683,12 +683,15 @@ void V8Debugger::PromiseEventOccurred(v8::debug::PromiseDebugActionType type,
}
std::shared_ptr<AsyncStackTrace> 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<AsyncStackTrace> 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<AsyncStackTrace> 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();
}
......
......@@ -298,14 +298,9 @@ AsyncStackTrace::AsyncStackTrace(
std::unique_ptr<protocol::Runtime::StackTrace>
AsyncStackTrace::buildInspectorObject(AsyncStackTrace* asyncCreation,
int maxAsyncDepth) const {
std::unique_ptr<protocol::Runtime::StackTrace> 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; }
......
......@@ -102,6 +102,11 @@ class AsyncStackTrace {
std::weak_ptr<AsyncStackTrace> 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<std::shared_ptr<StackFrame>> frames,
......
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)
......@@ -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 => {
......
......@@ -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)
......
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)
Checks that async stacks works for async/await
foo2 (test.js:15:2)
-- async function --
foo2 (test.js:13:19)
test (test.js:24:8)
(anonymous) (expr.js:0:0)
foo2 (test.js:17:2)
-- 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 --
foo2 (test.js:13:19)
test (test.js:24:8)
(anonymous) (expr.js:0:0)
foo1 (test.js:9:2)
(anonymous) (expr.js:0:0)
foo1 (test.js:9:2)
-- Promise.resolve (test.js:19:43)--
-- 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 --
foo2 (test.js:13:19)
test (test.js:24:8)
(anonymous) (expr.js:0:0)
......
......@@ -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)
......
......@@ -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(
......
......@@ -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)
......@@ -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
......
......@@ -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 : <scriptId>
url :
}
]
description : Promise.resolve
parent : {
callFrames : [
[0] : {
columnNumber : 23
functionName : resolve
lineNumber : 0
scriptId : <scriptId>
url :
}
[1] : {
columnNumber : 0
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
description : setTimeout
}
promiseCreationFrame : {
columnNumber : 47
functionName :
lineNumber : 0
scriptId : <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
......
// 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();
......
......@@ -21,6 +21,17 @@ Run expression 'console.trace()' with async chain len: 3
url :
}
]
parent : {
callFrames : [
[0] : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
}
}
timestamp : <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 : <scriptId>
url :
}
]
description : Promise.resolve
promiseCreationFrame : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
}
timestamp : <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 : <scriptId>
url :
}
}
promiseCreationFrame : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
description : Promise.resolve
}
}
timestamp : <timestamp>
......@@ -140,15 +139,15 @@ Run expression 'console.trace()' with async chain len: 3
]
parent : {
callFrames : [
[0] : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
description : Promise.resolve
promiseCreationFrame : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
}
timestamp : <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 : <scriptId>
url :
}
]
description : Promise.resolve
promiseCreationFrame : {
columnNumber : 18
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
promiseCreationFrame : {
columnNumber : 32
[0] : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
promiseCreationFrame : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
description : Promise.resolve
}
}
timestamp : <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 : <scriptId>
url :
}
]
description : Promise.resolve
promiseCreationFrame : {
columnNumber : 18
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
promiseCreationFrame : {
columnNumber : 32
[0] : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
}
promiseCreationFrame : {
columnNumber : 46
functionName :
lineNumber : 0
scriptId : <scriptId>
url :
}
]
description : Promise.resolve
}
}
timestamp : <timestamp>
......
// 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();
......
......@@ -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
......
......@@ -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(`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment