Commit fe3d51e1 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[inspector] Simplify async stepping

Currently, debugger pauses on async call schedule and then waits for Debugger.pauseOnAsyncCall
with parentStackTraceId to actually schedule the pause.

This CL combines these two steps:
- For local async tasks, it just stores m_taskWithScheduledBreak at the time of schedule,
  to be able to pause once this task is run.
- For external async tasks, it plumbs "should_pause" boolean in V8StackTraceId from
  the point of schedule to the point of execution, and schedules a pause once
  externalAsyncTaskStarted is called with "should_pause" set to true.

This approach greatly simplifies the implementation, and reduced frontend to a single
"breakOnAsyncCall: true" parameter in Debugger.stepInto.

Drive-by: introduce hasScheduledBreakOnNextFunctionCall() to make
SetBreakOnNextFunctionCall management more robust.

Note: artificial pauses at async call schedule time are gone from test expectations -
we now only pause when user actually wants to pause, which makes protocol much simpler.

See also design doc linked in the bug.

BUG=chromium:1000475

Change-Id: I2d16f79c599fe196b2aaeca8223c63437a2954a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1783724
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63737}
parent 25c11657
...@@ -237,7 +237,7 @@ domain Debugger ...@@ -237,7 +237,7 @@ domain Debugger
# Stops on the next JavaScript statement. # Stops on the next JavaScript statement.
command pause command pause
experimental command pauseOnAsyncCall experimental deprecated command pauseOnAsyncCall
parameters parameters
# Debugger will pause when async call with given stack trace is started. # Debugger will pause when async call with given stack trace is started.
Runtime.StackTraceId parentStackTraceId Runtime.StackTraceId parentStackTraceId
...@@ -435,7 +435,7 @@ domain Debugger ...@@ -435,7 +435,7 @@ domain Debugger
# Steps into the function call. # Steps into the function call.
command stepInto command stepInto
parameters parameters
# Debugger will issue additional Debugger.paused notification if any async task is scheduled # Debugger will pause on the execution of the first async task which was scheduled
# before next pause. # before next pause.
experimental optional boolean breakOnAsyncCall experimental optional boolean breakOnAsyncCall
...@@ -479,9 +479,8 @@ domain Debugger ...@@ -479,9 +479,8 @@ domain Debugger
optional Runtime.StackTrace asyncStackTrace optional Runtime.StackTrace asyncStackTrace
# Async stack trace, if any. # Async stack trace, if any.
experimental optional Runtime.StackTraceId asyncStackTraceId experimental optional Runtime.StackTraceId asyncStackTraceId
# Just scheduled async call will have this stack trace as parent stack during async execution. # Never present, will be removed.
# This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag. experimental deprecated optional Runtime.StackTraceId asyncCallStackTraceId
experimental optional Runtime.StackTraceId asyncCallStackTraceId
# Fired when the virtual machine resumed execution. # Fired when the virtual machine resumed execution.
event resumed event resumed
......
...@@ -1039,13 +1039,7 @@ Response V8DebuggerAgentImpl::stepOut() { ...@@ -1039,13 +1039,7 @@ Response V8DebuggerAgentImpl::stepOut() {
Response V8DebuggerAgentImpl::pauseOnAsyncCall( Response V8DebuggerAgentImpl::pauseOnAsyncCall(
std::unique_ptr<protocol::Runtime::StackTraceId> inParentStackTraceId) { std::unique_ptr<protocol::Runtime::StackTraceId> inParentStackTraceId) {
bool isOk = false; // Deprecated, just return OK.
int64_t stackTraceId = inParentStackTraceId->getId().toInteger64(&isOk);
if (!isOk) {
return Response::Error("Invalid stack trace id");
}
m_debugger->pauseOnAsyncCall(m_session->contextGroupId(), stackTraceId,
inParentStackTraceId->getDebuggerId(String16()));
return Response::OK(); return Response::OK();
} }
...@@ -1376,24 +1370,6 @@ V8DebuggerAgentImpl::currentExternalStackTrace() { ...@@ -1376,24 +1370,6 @@ V8DebuggerAgentImpl::currentExternalStackTrace() {
.build(); .build();
} }
std::unique_ptr<protocol::Runtime::StackTraceId>
V8DebuggerAgentImpl::currentScheduledAsyncCall() {
v8_inspector::V8StackTraceId scheduledAsyncCall =
m_debugger->scheduledAsyncCall();
if (scheduledAsyncCall.IsInvalid()) return nullptr;
std::unique_ptr<protocol::Runtime::StackTraceId> asyncCallStackTrace =
protocol::Runtime::StackTraceId::create()
.setId(stackTraceIdToString(scheduledAsyncCall.id))
.build();
// TODO(kozyatinskiy): extract this check to IsLocal function.
if (scheduledAsyncCall.debugger_id.first ||
scheduledAsyncCall.debugger_id.second) {
asyncCallStackTrace->setDebuggerId(
debuggerIdToString(scheduledAsyncCall.debugger_id));
}
return asyncCallStackTrace;
}
bool V8DebuggerAgentImpl::isPaused() const { bool V8DebuggerAgentImpl::isPaused() const {
return m_debugger->isPausedInContextGroup(m_session->contextGroupId()); return m_debugger->isPausedInContextGroup(m_session->contextGroupId());
} }
...@@ -1658,8 +1634,7 @@ void V8DebuggerAgentImpl::didPause( ...@@ -1658,8 +1634,7 @@ void V8DebuggerAgentImpl::didPause(
m_frontend.paused(std::move(protocolCallFrames), breakReason, m_frontend.paused(std::move(protocolCallFrames), breakReason,
std::move(breakAuxData), std::move(hitBreakpointIds), std::move(breakAuxData), std::move(hitBreakpointIds),
currentAsyncStackTrace(), currentExternalStackTrace(), currentAsyncStackTrace(), currentExternalStackTrace());
currentScheduledAsyncCall());
} }
void V8DebuggerAgentImpl::didContinue() { void V8DebuggerAgentImpl::didContinue() {
......
...@@ -165,7 +165,6 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend { ...@@ -165,7 +165,6 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend {
std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*); std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*);
std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace(); std::unique_ptr<protocol::Runtime::StackTrace> currentAsyncStackTrace();
std::unique_ptr<protocol::Runtime::StackTraceId> currentExternalStackTrace(); std::unique_ptr<protocol::Runtime::StackTraceId> currentExternalStackTrace();
std::unique_ptr<protocol::Runtime::StackTraceId> currentScheduledAsyncCall();
void setPauseOnExceptionsImpl(int); void setPauseOnExceptionsImpl(int);
......
...@@ -107,7 +107,9 @@ void V8Debugger::disable() { ...@@ -107,7 +107,9 @@ void V8Debugger::disable() {
if (--m_enableCount) return; if (--m_enableCount) return;
clearContinueToLocation(); clearContinueToLocation();
m_taskWithScheduledBreak = nullptr; m_taskWithScheduledBreak = nullptr;
m_taskWithScheduledBreakDebuggerId = String16(); m_externalAsyncTaskPauseRequested = false;
m_taskWithScheduledBreakPauseRequested = false;
m_pauseOnNextCallRequested = false;
m_pauseOnAsyncCall = false; m_pauseOnAsyncCall = false;
m_wasmTranslation.Clear(); m_wasmTranslation.Clear();
v8::debug::SetDebugDelegate(m_isolate, nullptr); v8::debug::SetDebugDelegate(m_isolate, nullptr);
...@@ -171,12 +173,19 @@ void V8Debugger::setPauseOnNextCall(bool pause, int targetContextGroupId) { ...@@ -171,12 +173,19 @@ void V8Debugger::setPauseOnNextCall(bool pause, int targetContextGroupId) {
m_targetContextGroupId != targetContextGroupId) { m_targetContextGroupId != targetContextGroupId) {
return; return;
} }
m_targetContextGroupId = targetContextGroupId; if (pause) {
m_breakRequested = pause; bool didHaveBreak = hasScheduledBreakOnNextFunctionCall();
if (pause) m_pauseOnNextCallRequested = true;
v8::debug::SetBreakOnNextFunctionCall(m_isolate); if (!didHaveBreak) {
else m_targetContextGroupId = targetContextGroupId;
v8::debug::ClearBreakOnNextFunctionCall(m_isolate); v8::debug::SetBreakOnNextFunctionCall(m_isolate);
}
} else {
m_pauseOnNextCallRequested = false;
if (!hasScheduledBreakOnNextFunctionCall()) {
v8::debug::ClearBreakOnNextFunctionCall(m_isolate);
}
}
} }
bool V8Debugger::canBreakProgram() { bool V8Debugger::canBreakProgram() {
...@@ -275,21 +284,12 @@ bool V8Debugger::asyncStepOutOfFunction(int targetContextGroupId, ...@@ -275,21 +284,12 @@ bool V8Debugger::asyncStepOutOfFunction(int targetContextGroupId,
void* parentTask = void* parentTask =
std::shared_ptr<AsyncStackTrace>(parent)->suspendedTaskId(); std::shared_ptr<AsyncStackTrace>(parent)->suspendedTaskId();
if (!parentTask) return false; if (!parentTask) return false;
pauseOnAsyncCall(targetContextGroupId, m_targetContextGroupId = targetContextGroupId;
reinterpret_cast<uintptr_t>(parentTask), String16()); m_taskWithScheduledBreak = parentTask;
continueProgram(targetContextGroupId); continueProgram(targetContextGroupId);
return true; return true;
} }
void V8Debugger::pauseOnAsyncCall(int targetContextGroupId, uintptr_t task,
const String16& debuggerId) {
DCHECK(targetContextGroupId);
m_targetContextGroupId = targetContextGroupId;
m_taskWithScheduledBreak = reinterpret_cast<void*>(task);
m_taskWithScheduledBreakDebuggerId = debuggerId;
}
void V8Debugger::terminateExecution( void V8Debugger::terminateExecution(
std::unique_ptr<TerminateExecutionCallback> callback) { std::unique_ptr<TerminateExecutionCallback> callback) {
if (m_terminateExecutionCallback) { if (m_terminateExecutionCallback) {
...@@ -390,10 +390,11 @@ void V8Debugger::handleProgramBreak( ...@@ -390,10 +390,11 @@ void V8Debugger::handleProgramBreak(
return; return;
} }
m_targetContextGroupId = 0; m_targetContextGroupId = 0;
m_breakRequested = false; m_pauseOnNextCallRequested = false;
m_pauseOnAsyncCall = false; m_pauseOnAsyncCall = false;
m_taskWithScheduledBreak = nullptr; m_taskWithScheduledBreak = nullptr;
m_taskWithScheduledBreakDebuggerId = String16(); m_externalAsyncTaskPauseRequested = false;
m_taskWithScheduledBreakPauseRequested = false;
bool scheduledOOMBreak = m_scheduledOOMBreak; bool scheduledOOMBreak = m_scheduledOOMBreak;
bool scheduledAssertBreak = m_scheduledAssertBreak; bool scheduledAssertBreak = m_scheduledAssertBreak;
...@@ -540,15 +541,15 @@ void V8Debugger::AsyncEventOccurred(v8::debug::DebugAsyncActionType type, ...@@ -540,15 +541,15 @@ void V8Debugger::AsyncEventOccurred(v8::debug::DebugAsyncActionType type,
switch (type) { switch (type) {
case v8::debug::kDebugPromiseThen: case v8::debug::kDebugPromiseThen:
asyncTaskScheduledForStack("Promise.then", task, false); asyncTaskScheduledForStack("Promise.then", task, false);
if (!isBlackboxed) asyncTaskCandidateForStepping(task, true); if (!isBlackboxed) asyncTaskCandidateForStepping(task);
break; break;
case v8::debug::kDebugPromiseCatch: case v8::debug::kDebugPromiseCatch:
asyncTaskScheduledForStack("Promise.catch", task, false); asyncTaskScheduledForStack("Promise.catch", task, false);
if (!isBlackboxed) asyncTaskCandidateForStepping(task, true); if (!isBlackboxed) asyncTaskCandidateForStepping(task);
break; break;
case v8::debug::kDebugPromiseFinally: case v8::debug::kDebugPromiseFinally:
asyncTaskScheduledForStack("Promise.finally", task, false); asyncTaskScheduledForStack("Promise.finally", task, false);
if (!isBlackboxed) asyncTaskCandidateForStepping(task, true); if (!isBlackboxed) asyncTaskCandidateForStepping(task);
break; break;
case v8::debug::kDebugWillHandle: case v8::debug::kDebugWillHandle:
asyncTaskStartedForStack(task); asyncTaskStartedForStack(task);
...@@ -811,9 +812,13 @@ V8StackTraceId V8Debugger::storeCurrentStackTrace( ...@@ -811,9 +812,13 @@ V8StackTraceId V8Debugger::storeCurrentStackTrace(
++m_asyncStacksCount; ++m_asyncStacksCount;
collectOldAsyncStacksIfNeeded(); collectOldAsyncStacksIfNeeded();
asyncTaskCandidateForStepping(reinterpret_cast<void*>(id), false); bool shouldPause =
m_pauseOnAsyncCall && contextGroupId == m_targetContextGroupId;
return V8StackTraceId(id, debuggerIdFor(contextGroupId)); if (shouldPause) {
m_pauseOnAsyncCall = false;
v8::debug::ClearStepping(m_isolate); // Cancel step into.
}
return V8StackTraceId(id, debuggerIdFor(contextGroupId), shouldPause);
} }
uintptr_t V8Debugger::storeStackTrace( uintptr_t V8Debugger::storeStackTrace(
...@@ -829,13 +834,12 @@ void V8Debugger::externalAsyncTaskStarted(const V8StackTraceId& parent) { ...@@ -829,13 +834,12 @@ void V8Debugger::externalAsyncTaskStarted(const V8StackTraceId& parent) {
m_currentAsyncParent.emplace_back(); m_currentAsyncParent.emplace_back();
m_currentTasks.push_back(reinterpret_cast<void*>(parent.id)); m_currentTasks.push_back(reinterpret_cast<void*>(parent.id));
if (m_breakRequested) return; if (!parent.should_pause) return;
if (!m_taskWithScheduledBreakDebuggerId.isEmpty() && bool didHaveBreak = hasScheduledBreakOnNextFunctionCall();
reinterpret_cast<uintptr_t>(m_taskWithScheduledBreak) == parent.id && m_externalAsyncTaskPauseRequested = true;
m_taskWithScheduledBreakDebuggerId == if (didHaveBreak) return;
debuggerIdToString(parent.debugger_id)) { m_targetContextGroupId = currentContextGroupId();
v8::debug::SetBreakOnNextFunctionCall(m_isolate); v8::debug::SetBreakOnNextFunctionCall(m_isolate);
}
} }
void V8Debugger::externalAsyncTaskFinished(const V8StackTraceId& parent) { void V8Debugger::externalAsyncTaskFinished(const V8StackTraceId& parent) {
...@@ -845,22 +849,16 @@ void V8Debugger::externalAsyncTaskFinished(const V8StackTraceId& parent) { ...@@ -845,22 +849,16 @@ void V8Debugger::externalAsyncTaskFinished(const V8StackTraceId& parent) {
DCHECK(m_currentTasks.back() == reinterpret_cast<void*>(parent.id)); DCHECK(m_currentTasks.back() == reinterpret_cast<void*>(parent.id));
m_currentTasks.pop_back(); m_currentTasks.pop_back();
if (m_taskWithScheduledBreakDebuggerId.isEmpty() || if (!parent.should_pause) return;
reinterpret_cast<uintptr_t>(m_taskWithScheduledBreak) != parent.id || m_externalAsyncTaskPauseRequested = false;
m_taskWithScheduledBreakDebuggerId != if (hasScheduledBreakOnNextFunctionCall()) return;
debuggerIdToString(parent.debugger_id)) {
return;
}
m_taskWithScheduledBreak = nullptr;
m_taskWithScheduledBreakDebuggerId = String16();
if (m_breakRequested) return;
v8::debug::ClearBreakOnNextFunctionCall(m_isolate); v8::debug::ClearBreakOnNextFunctionCall(m_isolate);
} }
void V8Debugger::asyncTaskScheduled(const StringView& taskName, void* task, void V8Debugger::asyncTaskScheduled(const StringView& taskName, void* task,
bool recurring) { bool recurring) {
asyncTaskScheduledForStack(toString16(taskName), task, recurring); asyncTaskScheduledForStack(toString16(taskName), task, recurring);
asyncTaskCandidateForStepping(task, true); asyncTaskCandidateForStepping(task);
} }
void V8Debugger::asyncTaskCanceled(void* task) { void V8Debugger::asyncTaskCanceled(void* task) {
...@@ -936,46 +934,36 @@ void V8Debugger::asyncTaskFinishedForStack(void* task) { ...@@ -936,46 +934,36 @@ void V8Debugger::asyncTaskFinishedForStack(void* task) {
} }
} }
void V8Debugger::asyncTaskCandidateForStepping(void* task, bool isLocal) { void V8Debugger::asyncTaskCandidateForStepping(void* task) {
if (!m_pauseOnAsyncCall) return; if (!m_pauseOnAsyncCall) return;
int contextGroupId = currentContextGroupId(); int contextGroupId = currentContextGroupId();
if (contextGroupId != m_targetContextGroupId) return; if (contextGroupId != m_targetContextGroupId) return;
if (isLocal) { m_taskWithScheduledBreak = task;
m_scheduledAsyncCall = v8_inspector::V8StackTraceId( m_pauseOnAsyncCall = false;
reinterpret_cast<uintptr_t>(task), std::make_pair(0, 0)); v8::debug::ClearStepping(m_isolate); // Cancel step into.
} else {
m_scheduledAsyncCall = v8_inspector::V8StackTraceId(
reinterpret_cast<uintptr_t>(task), debuggerIdFor(contextGroupId));
}
breakProgram(m_targetContextGroupId);
m_scheduledAsyncCall = v8_inspector::V8StackTraceId();
} }
void V8Debugger::asyncTaskStartedForStepping(void* task) { void V8Debugger::asyncTaskStartedForStepping(void* task) {
if (m_breakRequested) return;
// TODO(kozyatinskiy): we should search task in async chain to support // TODO(kozyatinskiy): we should search task in async chain to support
// blackboxing. // blackboxing.
if (m_taskWithScheduledBreakDebuggerId.isEmpty() && if (task != m_taskWithScheduledBreak) return;
task == m_taskWithScheduledBreak) { bool didHaveBreak = hasScheduledBreakOnNextFunctionCall();
v8::debug::SetBreakOnNextFunctionCall(m_isolate); m_taskWithScheduledBreakPauseRequested = true;
} if (didHaveBreak) return;
m_targetContextGroupId = currentContextGroupId();
v8::debug::SetBreakOnNextFunctionCall(m_isolate);
} }
void V8Debugger::asyncTaskFinishedForStepping(void* task) { void V8Debugger::asyncTaskFinishedForStepping(void* task) {
if (!m_taskWithScheduledBreakDebuggerId.isEmpty() || if (task != m_taskWithScheduledBreak) return;
task != m_taskWithScheduledBreak) {
return;
}
m_taskWithScheduledBreak = nullptr; m_taskWithScheduledBreak = nullptr;
if (m_breakRequested) return; m_taskWithScheduledBreakPauseRequested = false;
if (hasScheduledBreakOnNextFunctionCall()) return;
v8::debug::ClearBreakOnNextFunctionCall(m_isolate); v8::debug::ClearBreakOnNextFunctionCall(m_isolate);
} }
void V8Debugger::asyncTaskCanceledForStepping(void* task) { void V8Debugger::asyncTaskCanceledForStepping(void* task) {
if (!m_taskWithScheduledBreakDebuggerId.isEmpty() || asyncTaskFinishedForStepping(task);
task != m_taskWithScheduledBreak)
return;
m_taskWithScheduledBreak = nullptr;
} }
void V8Debugger::allAsyncTasksCanceled() { void V8Debugger::allAsyncTasksCanceled() {
...@@ -1110,4 +1098,9 @@ void V8Debugger::dumpAsyncTaskStacksStateForTest() { ...@@ -1110,4 +1098,9 @@ void V8Debugger::dumpAsyncTaskStacksStateForTest() {
fprintf(stdout, "\n"); fprintf(stdout, "\n");
} }
bool V8Debugger::hasScheduledBreakOnNextFunctionCall() const {
return m_pauseOnNextCallRequested || m_taskWithScheduledBreakPauseRequested ||
m_externalAsyncTaskPauseRequested;
}
} // namespace v8_inspector } // namespace v8_inspector
...@@ -59,8 +59,6 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -59,8 +59,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
void stepIntoStatement(int targetContextGroupId, bool breakOnAsyncCall); void stepIntoStatement(int targetContextGroupId, bool breakOnAsyncCall);
void stepOverStatement(int targetContextGroupId); void stepOverStatement(int targetContextGroupId);
void stepOutOfFunction(int targetContextGroupId); void stepOutOfFunction(int targetContextGroupId);
void pauseOnAsyncCall(int targetContextGroupId, uintptr_t task,
const String16& debuggerId);
void terminateExecution(std::unique_ptr<TerminateExecutionCallback> callback); void terminateExecution(std::unique_ptr<TerminateExecutionCallback> callback);
...@@ -121,10 +119,6 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -121,10 +119,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
void setMaxAsyncTaskStacksForTest(int limit); void setMaxAsyncTaskStacksForTest(int limit);
void dumpAsyncTaskStacksStateForTest(); void dumpAsyncTaskStacksStateForTest();
v8_inspector::V8StackTraceId scheduledAsyncCall() {
return m_scheduledAsyncCall;
}
std::pair<int64_t, int64_t> debuggerIdFor(int contextGroupId); std::pair<int64_t, int64_t> debuggerIdFor(int contextGroupId);
std::pair<int64_t, int64_t> debuggerIdFor( std::pair<int64_t, int64_t> debuggerIdFor(
const String16& serializedDebuggerId); const String16& serializedDebuggerId);
...@@ -173,7 +167,7 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -173,7 +167,7 @@ class V8Debugger : public v8::debug::DebugDelegate,
void asyncTaskStartedForStack(void* task); void asyncTaskStartedForStack(void* task);
void asyncTaskFinishedForStack(void* task); void asyncTaskFinishedForStack(void* task);
void asyncTaskCandidateForStepping(void* task, bool isLocal); void asyncTaskCandidateForStepping(void* task);
void asyncTaskStartedForStepping(void* task); void asyncTaskStartedForStepping(void* task);
void asyncTaskFinishedForStepping(void* task); void asyncTaskFinishedForStepping(void* task);
void asyncTaskCanceledForStepping(void* task); void asyncTaskCanceledForStepping(void* task);
...@@ -197,6 +191,8 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -197,6 +191,8 @@ class V8Debugger : public v8::debug::DebugDelegate,
int currentContextGroupId(); int currentContextGroupId();
bool asyncStepOutOfFunction(int targetContextGroupId, bool onlyAtReturn); bool asyncStepOutOfFunction(int targetContextGroupId, bool onlyAtReturn);
bool hasScheduledBreakOnNextFunctionCall() const;
v8::Isolate* m_isolate; v8::Isolate* m_isolate;
V8InspectorImpl* m_inspector; V8InspectorImpl* m_inspector;
int m_enableCount; int m_enableCount;
...@@ -233,13 +229,17 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -233,13 +229,17 @@ class V8Debugger : public v8::debug::DebugDelegate,
std::unordered_map<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap; std::unordered_map<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap;
void* m_taskWithScheduledBreak = nullptr; void* m_taskWithScheduledBreak = nullptr;
String16 m_taskWithScheduledBreakDebuggerId;
bool m_breakRequested = false; // If any of the following three is true, we schedule pause on next JS
// execution using SetBreakOnNextFunctionCall.
bool m_externalAsyncTaskPauseRequested = false; // External async task.
bool m_taskWithScheduledBreakPauseRequested = false; // Local async task.
bool m_pauseOnNextCallRequested = false; // setPauseOnNextCall API call.
v8::debug::ExceptionBreakState m_pauseOnExceptionsState; v8::debug::ExceptionBreakState m_pauseOnExceptionsState;
// Whether we should pause on async call execution (if any) while stepping in.
// See Debugger.stepInto for details.
bool m_pauseOnAsyncCall = false; bool m_pauseOnAsyncCall = false;
v8_inspector::V8StackTraceId m_scheduledAsyncCall;
using StackTraceIdToStackTrace = using StackTraceIdToStackTrace =
std::unordered_map<uintptr_t, std::weak_ptr<AsyncStackTrace>>; std::unordered_map<uintptr_t, std::weak_ptr<AsyncStackTrace>>;
......
...@@ -28,13 +28,6 @@ paused at: ...@@ -28,13 +28,6 @@ paused at:
#Promise.resolve().then(v => v * 2); #Promise.resolve().then(v => v * 2);
} }
paused at:
debugger;
Promise.resolve().#then(v => v * 2);
}
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
Promise.resolve().then(v => v #* 2); Promise.resolve().then(v => v #* 2);
...@@ -52,13 +45,6 @@ paused at: ...@@ -52,13 +45,6 @@ paused at:
p.#then(v => v * 2); p.#then(v => v * 2);
resolveCallback(); resolveCallback();
paused at:
debugger;
p.#then(v => v * 2);
resolveCallback();
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
p.then(v => v #* 2); p.then(v => v #* 2);
...@@ -76,13 +62,6 @@ paused at: ...@@ -76,13 +62,6 @@ paused at:
#Promise.resolve().then(v => v * 2); #Promise.resolve().then(v => v * 2);
Promise.resolve().then(v => v * 4); Promise.resolve().then(v => v * 4);
paused at:
debugger;
Promise.resolve().#then(v => v * 2);
Promise.resolve().then(v => v * 4);
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
Promise.resolve().then(v => v #* 2); Promise.resolve().then(v => v #* 2);
...@@ -105,13 +84,6 @@ paused at: ...@@ -105,13 +84,6 @@ paused at:
#Promise.resolve().then(v => v * 4); #Promise.resolve().then(v => v * 4);
} }
paused at:
Promise.resolve().then(v => v * 2);
Promise.resolve().#then(v => v * 4);
}
asyncCallStackTraceId is set
paused at: paused at:
Promise.resolve().then(v => v * 2); Promise.resolve().then(v => v * 2);
Promise.resolve().then(v => v #* 4); Promise.resolve().then(v => v #* 4);
...@@ -129,13 +101,6 @@ paused at: ...@@ -129,13 +101,6 @@ paused at:
#Promise.resolve().then(v => v * 2); #Promise.resolve().then(v => v * 2);
debugger; debugger;
paused at:
debugger;
Promise.resolve().#then(v => v * 2);
debugger;
asyncCallStackTraceId is set
paused at: paused at:
Promise.resolve().then(v => v * 2); Promise.resolve().then(v => v * 2);
#debugger; #debugger;
...@@ -146,13 +111,6 @@ paused at: ...@@ -146,13 +111,6 @@ paused at:
#Promise.resolve().then(v => v * 4); #Promise.resolve().then(v => v * 4);
} }
paused at:
debugger;
Promise.resolve().#then(v => v * 4);
}
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
Promise.resolve().then(v => v #* 4); Promise.resolve().then(v => v #* 4);
...@@ -170,13 +128,6 @@ paused at: ...@@ -170,13 +128,6 @@ paused at:
#Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2); #Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
} }
paused at:
debugger;
Promise.all([ Promise.resolve(), Promise.resolve() ]).#then(v => v * 2);
}
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v #* 2); Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v #* 2);
...@@ -194,13 +145,6 @@ paused at: ...@@ -194,13 +145,6 @@ paused at:
#createPromise().then(v => v * 2); #createPromise().then(v => v * 2);
} }
paused at:
debugger;
createPromise().#then(v => v * 2);
}
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
createPromise().then(v => v #* 2); createPromise().then(v => v #* 2);
...@@ -218,13 +162,6 @@ paused at: ...@@ -218,13 +162,6 @@ paused at:
#createPromise().then(v => v * 2); #createPromise().then(v => v * 2);
} }
paused at:
debugger;
createPromise().#then(v => v * 2);
}
asyncCallStackTraceId is set
paused at: paused at:
debugger; debugger;
createPromise().then(v => v #* 2); createPromise().then(v => v #* 2);
...@@ -272,13 +209,6 @@ paused at: ...@@ -272,13 +209,6 @@ paused at:
foo().#then(boo); foo().#then(boo);
paused at:
await foo();
foo().#then(boo);
asyncCallStackTraceId is set
paused at: paused at:
function boo() { function boo() {
#} #}
......
...@@ -12,9 +12,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -12,9 +12,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -26,9 +23,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -26,9 +23,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
await Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
...@@ -43,9 +37,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -43,9 +37,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
await InspectorTest.waitForPendingTasks(); await InspectorTest.waitForPendingTasks();
...@@ -57,9 +48,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -57,9 +48,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -69,20 +57,14 @@ InspectorTest.runAsyncTestSuite([ ...@@ -69,20 +57,14 @@ InspectorTest.runAsyncTestSuite([
Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'}); Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
} }
]); ]);
async function waitPauseAndDumpLocation() { async function waitPauseAndDumpLocation() {
var {params: {callFrames, asyncCallStackTraceId}} = var {params: {callFrames}} =
await Protocol.Debugger.oncePaused(); await Protocol.Debugger.oncePaused();
if (!asyncCallStackTraceId) { InspectorTest.log('paused at:');
InspectorTest.log('paused at:'); await session.logSourceLocation(callFrames[0].location);
await session.logSourceLocation(callFrames[0].location);
}
return asyncCallStackTraceId;
} }
...@@ -90,9 +90,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -90,9 +90,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -103,9 +100,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -103,9 +100,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -116,9 +110,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -116,9 +110,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepInto(); Protocol.Debugger.stepInto();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -131,9 +122,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -131,9 +122,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -144,16 +132,10 @@ InspectorTest.runAsyncTestSuite([ ...@@ -144,16 +132,10 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -164,9 +146,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -164,9 +146,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -178,9 +157,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -178,9 +157,6 @@ InspectorTest.runAsyncTestSuite([
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js'] }); await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js'] });
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -192,9 +168,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -192,9 +168,6 @@ InspectorTest.runAsyncTestSuite([
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
}, },
...@@ -205,17 +178,11 @@ InspectorTest.runAsyncTestSuite([ ...@@ -205,17 +178,11 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOver(); Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
if (parentStackTraceId)
InspectorTest.log(
'ERROR: we should not report parent stack trace id on async call');
Protocol.Debugger.stepOut(); Protocol.Debugger.stepOut();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
parentStackTraceId = await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
if (parentStackTraceId)
InspectorTest.log(
'ERROR: we should not report parent stack trace id on async call');
Protocol.Debugger.stepOut(); Protocol.Debugger.stepOut();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
...@@ -223,9 +190,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -223,9 +190,6 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.stepOut(); Protocol.Debugger.stepOut();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation(); await waitPauseAndDumpLocation();
await Protocol.Debugger.resume(); await Protocol.Debugger.resume();
...@@ -233,12 +197,8 @@ InspectorTest.runAsyncTestSuite([ ...@@ -233,12 +197,8 @@ InspectorTest.runAsyncTestSuite([
]); ]);
async function waitPauseAndDumpLocation() { async function waitPauseAndDumpLocation() {
var {params: {callFrames, asyncCallStackTraceId}} = var {params: {callFrames}} =
await Protocol.Debugger.oncePaused(); await Protocol.Debugger.oncePaused();
InspectorTest.log('paused at:'); InspectorTest.log('paused at:');
await session.logSourceLocation(callFrames[0].location); await session.logSourceLocation(callFrames[0].location);
if (asyncCallStackTraceId) {
InspectorTest.log('asyncCallStackTraceId is set\n');
}
return asyncCallStackTraceId;
} }
Test for Debugger.stepInto with breakOnAsyncCall. Test for Debugger.stepInto with breakOnAsyncCall.
Running test: testSetTimeout Running test: testSetTimeout
(anonymous) (test.js:0:0)
asyncCallStackTraceId is set
(anonymous) (test.js:0:17) (anonymous) (test.js:0:17)
asyncCallStackTraceId is empty
Running test: testPromiseThen Running test: testPromiseThen
(anonymous) (test.js:0:2)
asyncCallStackTraceId is set
(anonymous) (test.js:0:13) (anonymous) (test.js:0:13)
asyncCallStackTraceId is empty
...@@ -17,21 +17,8 @@ InspectorTest.runAsyncTestSuite([ ...@@ -17,21 +17,8 @@ InspectorTest.runAsyncTestSuite([
}); });
await pausedPromise; await pausedPromise;
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let {params: {callFrames, asyncCallStackTraceId}} = let {params: {callFrames}} = await Protocol.Debugger.oncePaused();
await Protocol.Debugger.oncePaused();
session.logCallFrames(callFrames); session.logCallFrames(callFrames);
if (asyncCallStackTraceId) {
InspectorTest.log('asyncCallStackTraceId is set');
}
Protocol.Debugger.pauseOnAsyncCall(
{parentStackTraceId: asyncCallStackTraceId});
pausedPromise = Protocol.Debugger.oncePaused();
Protocol.Debugger.resume();
({params: {callFrames, asyncCallStackTraceId}} = await pausedPromise);
session.logCallFrames(callFrames);
if (!asyncCallStackTraceId) {
InspectorTest.log('asyncCallStackTraceId is empty');
}
await Protocol.Debugger.disable(); await Protocol.Debugger.disable();
}, },
...@@ -45,21 +32,8 @@ InspectorTest.runAsyncTestSuite([ ...@@ -45,21 +32,8 @@ InspectorTest.runAsyncTestSuite([
Protocol.Runtime.evaluate({expression: 'p.then(() => 42)//# sourceURL=test.js'}); Protocol.Runtime.evaluate({expression: 'p.then(() => 42)//# sourceURL=test.js'});
await pausedPromise; await pausedPromise;
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let {params: {callFrames, asyncCallStackTraceId}} = let {params: {callFrames}} = await Protocol.Debugger.oncePaused();
await Protocol.Debugger.oncePaused();
session.logCallFrames(callFrames);
if (asyncCallStackTraceId) {
InspectorTest.log('asyncCallStackTraceId is set');
}
Protocol.Debugger.pauseOnAsyncCall(
{parentStackTraceId: asyncCallStackTraceId});
pausedPromise = Protocol.Debugger.oncePaused();
Protocol.Debugger.resume();
({params: {callFrames, asyncCallStackTraceId}} = await pausedPromise);
session.logCallFrames(callFrames); session.logCallFrames(callFrames);
if (!asyncCallStackTraceId) {
InspectorTest.log('asyncCallStackTraceId is empty');
}
await Protocol.Debugger.disable(); await Protocol.Debugger.disable();
} }
]); ]);
...@@ -2,7 +2,6 @@ Test for step-into remote async task ...@@ -2,7 +2,6 @@ Test for step-into remote async task
Setup debugger agents.. Setup debugger agents..
Pause before stack trace is captured.. Pause before stack trace is captured..
Run stepInto with breakOnAsyncCall flag Run stepInto with breakOnAsyncCall flag
Call pauseOnAsyncCall
Trigger external async task on another context group Trigger external async task on another context group
Dump stack trace Dump stack trace
boo (target.js:1:22) boo (target.js:1:22)
......
...@@ -2,7 +2,6 @@ Test for step-into remote async task. ...@@ -2,7 +2,6 @@ Test for step-into remote async task.
Setup debugger agents.. Setup debugger agents..
Pause before stack trace is captured.. Pause before stack trace is captured..
Run stepInto with breakOnAsyncCall flag Run stepInto with breakOnAsyncCall flag
Call pauseOnAsyncCall
Trigger external async task on another context group Trigger external async task on another context group
Dump stack trace Dump stack trace
boo (target.js:1:22) boo (target.js:1:22)
......
...@@ -42,13 +42,6 @@ session.setupScriptMap(); ...@@ -42,13 +42,6 @@ session.setupScriptMap();
InspectorTest.log('Run stepInto with breakOnAsyncCall flag'); InspectorTest.log('Run stepInto with breakOnAsyncCall flag');
Protocol.Debugger.stepInto({breakOnAsyncCall: true}); Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let {params: {asyncCallStackTraceId}} = await Protocol.Debugger.oncePaused();
InspectorTest.log('Call pauseOnAsyncCall');
Protocol.Debugger.pauseOnAsyncCall({
parentStackTraceId: asyncCallStackTraceId,
});
Protocol.Debugger.resume();
InspectorTest.log('Trigger external async task on another context group'); InspectorTest.log('Trigger external async task on another context group');
let stackTraceId = (await evaluatePromise).result.result.value; let stackTraceId = (await evaluatePromise).result.result.value;
......
...@@ -62,13 +62,6 @@ session2.setupScriptMap(); ...@@ -62,13 +62,6 @@ session2.setupScriptMap();
InspectorTest.log('Run stepInto with breakOnAsyncCall flag'); InspectorTest.log('Run stepInto with breakOnAsyncCall flag');
Protocol1.Debugger.stepInto({breakOnAsyncCall: true}); Protocol1.Debugger.stepInto({breakOnAsyncCall: true});
let {params: {asyncCallStackTraceId}} = await Protocol1.Debugger.oncePaused();
InspectorTest.log('Call pauseOnAsyncCall');
Protocol2.Debugger.pauseOnAsyncCall({
parentStackTraceId: asyncCallStackTraceId,
});
Protocol1.Debugger.resume();
InspectorTest.log('Trigger external async task on another context group'); InspectorTest.log('Trigger external async task on another context group');
let stackTraceId = (await evaluatePromise).result.result.value; let stackTraceId = (await evaluatePromise).result.result.value;
......
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