Commit ed2e7eb9 authored by Aleksei Koziatinskii's avatar Aleksei Koziatinskii Committed by Commit Bot

inspector: removed deprecated Debugger.scheduleStepIntoAsync

This method was experimental and deprecated for a while.

R=dgozman@chromium.org

Bug: none
Change-Id: I7d5a13a83f36ecc7a92300f690dff5c8bb26f8de
Reviewed-on: https://chromium-review.googlesource.com/c/1354182Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57920}
parent f4775f1c
......@@ -16,7 +16,6 @@
},
{
"domain": "Debugger",
"async": [ "scheduleStepIntoAsync" ],
"exported": ["SearchMatch", "paused.reason"]
},
{
......
......@@ -545,11 +545,6 @@
"name": "resume",
"description": "Resumes JavaScript execution."
},
{
"name": "scheduleStepIntoAsync",
"description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and\nDebugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled\nbefore next pause. Returns success when async task is actually scheduled, returns error if no\ntask were scheduled or another scheduleStepIntoAsync was called.",
"experimental": true
},
{
"name": "searchInContent",
"description": "Searches for given string in script content.",
......
......@@ -259,12 +259,6 @@ domain Debugger
# Resumes JavaScript execution.
command resume
# This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and
# Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled
# before next pause. Returns success when async task is actually scheduled, returns error if no
# task were scheduled or another scheduleStepIntoAsync was called.
experimental command scheduleStepIntoAsync
# Searches for given string in script content.
command searchInContent
parameters
......
......@@ -1004,16 +1004,6 @@ Response V8DebuggerAgentImpl::stepOut() {
return Response::OK();
}
void V8DebuggerAgentImpl::scheduleStepIntoAsync(
std::unique_ptr<ScheduleStepIntoAsyncCallback> callback) {
if (!isPaused()) {
callback->sendFailure(Response::Error(kDebuggerNotPaused));
return;
}
m_debugger->scheduleStepIntoAsync(std::move(callback),
m_session->contextGroupId());
}
Response V8DebuggerAgentImpl::pauseOnAsyncCall(
std::unique_ptr<protocol::Runtime::StackTraceId> inParentStackTraceId) {
bool isOk = false;
......
......@@ -96,8 +96,6 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend {
Response stepOver() override;
Response stepInto(Maybe<bool> inBreakOnAsyncCall) override;
Response stepOut() override;
void scheduleStepIntoAsync(
std::unique_ptr<ScheduleStepIntoAsyncCallback> callback) override;
Response pauseOnAsyncCall(std::unique_ptr<protocol::Runtime::StackTraceId>
inParentStackTraceId) override;
Response setPauseOnExceptions(const String16& pauseState) override;
......
......@@ -279,19 +279,6 @@ bool V8Debugger::asyncStepOutOfFunction(int targetContextGroupId,
return true;
}
void V8Debugger::scheduleStepIntoAsync(
std::unique_ptr<ScheduleStepIntoAsyncCallback> callback,
int targetContextGroupId) {
DCHECK(isPaused());
DCHECK(targetContextGroupId);
if (m_stepIntoAsyncCallback) {
m_stepIntoAsyncCallback->sendFailure(Response::Error(
"Current scheduled step into async was overriden with new one."));
}
m_targetContextGroupId = targetContextGroupId;
m_stepIntoAsyncCallback = std::move(callback);
}
void V8Debugger::pauseOnAsyncCall(int targetContextGroupId, uintptr_t task,
const String16& debuggerId) {
DCHECK(targetContextGroupId);
......@@ -393,11 +380,6 @@ void V8Debugger::handleProgramBreak(
return;
}
m_targetContextGroupId = 0;
if (m_stepIntoAsyncCallback) {
m_stepIntoAsyncCallback->sendFailure(
Response::Error("No async tasks were scheduled before pause."));
m_stepIntoAsyncCallback.reset();
}
m_breakRequested = false;
m_pauseOnAsyncCall = false;
m_taskWithScheduledBreak = nullptr;
......@@ -973,8 +955,9 @@ void V8Debugger::asyncTaskFinishedForStack(void* task) {
}
void V8Debugger::asyncTaskCandidateForStepping(void* task, bool isLocal) {
if (!m_pauseOnAsyncCall) return;
int contextGroupId = currentContextGroupId();
if (m_pauseOnAsyncCall && contextGroupId) {
if (contextGroupId != m_targetContextGroupId) return;
if (isLocal) {
m_scheduledAsyncCall = v8_inspector::V8StackTraceId(
reinterpret_cast<uintptr_t>(task), std::make_pair(0, 0));
......@@ -984,15 +967,6 @@ void V8Debugger::asyncTaskCandidateForStepping(void* task, bool isLocal) {
}
breakProgram(m_targetContextGroupId);
m_scheduledAsyncCall = v8_inspector::V8StackTraceId();
return;
}
if (!m_stepIntoAsyncCallback) return;
DCHECK(m_targetContextGroupId);
if (contextGroupId != m_targetContextGroupId) return;
m_taskWithScheduledBreak = task;
v8::debug::ClearStepping(m_isolate);
m_stepIntoAsyncCallback->sendSuccess();
m_stepIntoAsyncCallback.reset();
}
void V8Debugger::asyncTaskStartedForStepping(void* task) {
......
......@@ -34,8 +34,6 @@ enum class WrapMode { kForceValue, kNoPreview, kWithPreview };
enum class V8InternalValueType { kNone, kEntry, kScope, kScopeList };
using protocol::Response;
using ScheduleStepIntoAsyncCallback =
protocol::Debugger::Backend::ScheduleStepIntoAsyncCallback;
using TerminateExecutionCallback =
protocol::Runtime::Backend::TerminateExecutionCallback;
......@@ -62,9 +60,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
void stepIntoStatement(int targetContextGroupId, bool breakOnAsyncCall);
void stepOverStatement(int targetContextGroupId);
void stepOutOfFunction(int targetContextGroupId);
void scheduleStepIntoAsync(
std::unique_ptr<ScheduleStepIntoAsyncCallback> callback,
int targetContextGroupId);
void pauseOnAsyncCall(int targetContextGroupId, uintptr_t task,
const String16& debuggerId);
......@@ -242,7 +237,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
void* m_taskWithScheduledBreak = nullptr;
String16 m_taskWithScheduledBreakDebuggerId;
std::unique_ptr<ScheduleStepIntoAsyncCallback> m_stepIntoAsyncCallback;
bool m_breakRequested = false;
v8::debug::ExceptionBreakState m_pauseOnExceptionsState;
......
Checks Debugger.scheduleStepIntoAsync with setTimeout.
Checks Debugger.pauseOnAsynCall with setTimeout.
Running test: testSetTimeout
paused at:
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.scheduleStepIntoAsync with setTimeout.');
let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.pauseOnAsynCall with setTimeout.');
session.setupScriptMap();
Protocol.Debugger.enable();
InspectorTest.runAsyncTestSuite([
......@@ -11,8 +11,10 @@ InspectorTest.runAsyncTestSuite([
await Protocol.Debugger.oncePaused();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync();
Protocol.Debugger.stepOver();
Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
......@@ -23,8 +25,10 @@ InspectorTest.runAsyncTestSuite([
await Protocol.Debugger.oncePaused();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync();
Protocol.Debugger.stepOver();
Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
await Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
......@@ -38,8 +42,10 @@ InspectorTest.runAsyncTestSuite([
await Protocol.Debugger.oncePaused();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync();
Protocol.Debugger.stepOver();
Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
await InspectorTest.waitForPendingTasks();
......@@ -50,8 +56,10 @@ InspectorTest.runAsyncTestSuite([
await Protocol.Debugger.oncePaused();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync();
Protocol.Debugger.stepOver();
Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
......@@ -60,7 +68,9 @@ InspectorTest.runAsyncTestSuite([
Protocol.Debugger.pause();
Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync();
Protocol.Debugger.stepInto({breakOnAsyncCall: true});
let parentStackTraceId = await waitPauseAndDumpLocation();
Protocol.Debugger.pauseOnAsyncCall({parentStackTraceId});
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
......@@ -68,8 +78,11 @@ InspectorTest.runAsyncTestSuite([
]);
async function waitPauseAndDumpLocation() {
var message = await Protocol.Debugger.oncePaused();
var {params: {callFrames, asyncCallStackTraceId}} =
await Protocol.Debugger.oncePaused();
if (!asyncCallStackTraceId) {
InspectorTest.log('paused at:');
await session.logSourceLocation(message.params.callFrames[0].location);
return message;
await session.logSourceLocation(callFrames[0].location);
}
return asyncCallStackTraceId;
}
Checks Debugger.scheduleStepIntoAsync.
Running test: testScheduleErrors
paused at:
function testNoScheduledTask() {
#debugger;
return 42;
{
error : {
code : -32000
message : Current scheduled step into async was overriden with new one.
}
id : <messageId>
}
{
error : {
code : -32000
message : No async tasks were scheduled before pause.
}
id : <messageId>
}
paused at:
debugger;
#return 42;
}
Running test: testSimple
paused at:
function testSimple() {
#debugger;
Promise.resolve().then(v => v * 2);
paused at:
debugger;
#Promise.resolve().then(v => v * 2);
}
{
id : <messageId>
result : {
}
}
paused at:
debugger;
Promise.resolve().then(v => v #* 2);
}
Running test: testNotResolvedPromise
paused at:
var p = new Promise(resolve => resolveCallback = resolve);
#debugger;
p.then(v => v * 2);
paused at:
debugger;
p.#then(v => v * 2);
resolveCallback();
{
id : <messageId>
result : {
}
}
paused at:
debugger;
p.then(v => v #* 2);
resolveCallback();
Running test: testTwoAsyncTasks
paused at:
function testTwoAsyncTasks() {
#debugger;
Promise.resolve().then(v => v * 2);
{
id : <messageId>
result : {
}
}
paused at:
debugger;
Promise.resolve().then(v => v #* 2);
Promise.resolve().then(v => v * 4);
Running test: testTwoTasksAndGoToSecond
paused at:
function testTwoAsyncTasks() {
#debugger;
Promise.resolve().then(v => v * 2);
paused at:
debugger;
#Promise.resolve().then(v => v * 2);
Promise.resolve().then(v => v * 4);
paused at:
Promise.resolve().then(v => v * 2);
#Promise.resolve().then(v => v * 4);
}
{
id : <messageId>
result : {
}
}
paused at:
Promise.resolve().then(v => v * 2);
Promise.resolve().then(v => v #* 4);
}
Running test: testTwoAsyncTasksWithBreak
paused at:
function testTwoAsyncTasksWithBreak() {
#debugger;
Promise.resolve().then(v => v * 2);
paused at:
debugger;
#Promise.resolve().then(v => v * 2);
debugger;
{
id : <messageId>
result : {
}
}
paused at:
Promise.resolve().then(v => v * 2);
#debugger;
Promise.resolve().then(v => v * 4);
{
id : <messageId>
result : {
}
}
paused at:
debugger;
Promise.resolve().then(v => v #* 4);
}
Running test: testPromiseAll
paused at:
function testPromiseAll() {
#debugger;
Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
paused at:
debugger;
#Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
}
{
id : <messageId>
result : {
}
}
paused at:
debugger;
Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v #* 2);
}
Running test: testWithBlackboxedCode
paused at:
function testBlackboxedCreatePromise() {
#debugger;
createPromise().then(v => v * 2);
paused at:
debugger;
#createPromise().then(v => v * 2);
}
{
id : <messageId>
result : {
}
}
paused at:
debugger;
createPromise().then(v => v #* 2);
}
// 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.
let {session, contextGroup, Protocol} = InspectorTest.start('Checks Debugger.scheduleStepIntoAsync.');
contextGroup.addScript(`
function testNoScheduledTask() {
debugger;
return 42;
}
function testSimple() {
debugger;
Promise.resolve().then(v => v * 2);
}
function testNotResolvedPromise() {
var resolveCallback;
var p = new Promise(resolve => resolveCallback = resolve);
debugger;
p.then(v => v * 2);
resolveCallback();
}
function testTwoAsyncTasks() {
debugger;
Promise.resolve().then(v => v * 2);
Promise.resolve().then(v => v * 4);
}
function testTwoAsyncTasksWithBreak() {
debugger;
Promise.resolve().then(v => v * 2);
debugger;
Promise.resolve().then(v => v * 4);
}
function testPromiseAll() {
debugger;
Promise.all([ Promise.resolve(), Promise.resolve() ]).then(v => v * 2);
}
function testBlackboxedCreatePromise() {
debugger;
createPromise().then(v => v * 2);
}
//# sourceURL=test.js`);
contextGroup.addScript(`
function createPromise() {
return Promise.resolve().then(v => v * 3).then(v => v * 4);
}
//# sourceURL=framework.js`)
session.setupScriptMap();
Protocol.Debugger.enable();
Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 128});
InspectorTest.runAsyncTestSuite([
async function testScheduleErrors() {
Protocol.Runtime.evaluate({ expression: 'testNoScheduledTask()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.stepInto();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testSimple() {
Protocol.Runtime.evaluate({ expression: 'testSimple()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.stepInto();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testNotResolvedPromise() {
Protocol.Runtime.evaluate({ expression: 'testNotResolvedPromise()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.stepInto();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testTwoAsyncTasks() {
Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasks()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testTwoTasksAndGoToSecond() {
Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasks()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testTwoAsyncTasksWithBreak() {
Protocol.Runtime.evaluate({ expression: 'testTwoAsyncTasksWithBreak()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.resume();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testPromiseAll() {
Protocol.Runtime.evaluate({ expression: 'testPromiseAll()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
},
async function testWithBlackboxedCode() {
Protocol.Runtime.evaluate({ expression: 'testBlackboxedCreatePromise()' });
await waitPauseAndDumpLocation();
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
await Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js'] });
Protocol.Debugger.scheduleStepIntoAsync().then(InspectorTest.logMessage);
Protocol.Debugger.stepOver();
await waitPauseAndDumpLocation();
await Protocol.Debugger.resume();
}
]);
async function waitPauseAndDumpLocation() {
var message = await Protocol.Debugger.oncePaused();
InspectorTest.log('paused at:');
session.logSourceLocation(message.params.callFrames[0].location);
return message;
}
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