inspector: fixed Debugger.restartFrame
This mistake was introduced during big liveedit refactoring. Reported in Node.js: https://github.com/nodejs/node/issues/28493 R=dgozman@chromium.org,yangguo@chromium.org Change-Id: Ic19984f1776dd5e0a25c6d7c41b4a7b7a9c76d22 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1683101 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#62479}
This commit is contained in:
parent
8b40f97fb8
commit
12f4751942
@ -167,7 +167,7 @@ DebugStackTraceIterator::GetScopeIterator() const {
|
||||
bool DebugStackTraceIterator::Restart() {
|
||||
DCHECK(!Done());
|
||||
if (iterator_.is_wasm()) return false;
|
||||
return !LiveEdit::RestartFrame(iterator_.javascript_frame());
|
||||
return LiveEdit::RestartFrame(iterator_.javascript_frame());
|
||||
}
|
||||
|
||||
v8::MaybeLocal<v8::Value> DebugStackTraceIterator::Evaluate(
|
||||
|
10
test/inspector/debugger/restart-frame-expected.txt
Normal file
10
test/inspector/debugger/restart-frame-expected.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Checks that Debugger.restartFrame works
|
||||
Paused at debugger:
|
||||
function foo() { #debugger; }; foo();
|
||||
|
||||
Call restart and dump location of restart:
|
||||
function foo() { debugger; }; #foo();
|
||||
|
||||
Location after restart:
|
||||
function foo() { #debugger; }; foo();
|
||||
|
33
test/inspector/debugger/restart-frame.js
Normal file
33
test/inspector/debugger/restart-frame.js
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2019 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
const {session, Protocol} =
|
||||
InspectorTest.start('Checks that Debugger.restartFrame works');
|
||||
|
||||
session.setupScriptMap();
|
||||
|
||||
(async function test() {
|
||||
Protocol.Debugger.enable();
|
||||
const evalPromise = Protocol.Runtime.evaluate({
|
||||
expression: 'function foo() { debugger; }; foo();'
|
||||
});
|
||||
InspectorTest.log('Paused at debugger:');
|
||||
const { params: { callFrames: before } } =
|
||||
await Protocol.Debugger.oncePaused();
|
||||
await session.logSourceLocation(before[0].location);
|
||||
InspectorTest.log('Call restart and dump location of restart:');
|
||||
const { result: { callFrames: restart }} =
|
||||
await Protocol.Debugger.restartFrame({
|
||||
callFrameId: before[0].callFrameId
|
||||
});
|
||||
await session.logSourceLocation(restart[0].location);
|
||||
InspectorTest.log('Location after restart:');
|
||||
Protocol.Debugger.resume();
|
||||
const { params: { callFrames: after } } =
|
||||
await Protocol.Debugger.oncePaused();
|
||||
await session.logSourceLocation(after[0].location);
|
||||
Protocol.Debugger.resume();
|
||||
await evalPromise;
|
||||
InspectorTest.completeTest();
|
||||
})()
|
Loading…
Reference in New Issue
Block a user