Commit 15bb2488 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[liftoff][debug] Clear stepping in JS

We were sometimes stopping on a one-shot breakpoints in JS code even
though the last user action was actually a resume.
This CL fixes that clearing all stepping in JS whenever we hit a
breakpoint in wasm.

R=thibaudm@chromium.org

Bug: v8:10321
Change-Id: Ie5d12bb0c9e766bcbd5ad0aa225a8b14b4d608b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120588Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66869}
parent f5fefba3
......@@ -621,6 +621,7 @@ RUNTIME_FUNCTION(Runtime_WasmDebugBreak) {
auto* debug_info = frame->native_module()->GetDebugInfo();
if (debug_info->IsStepping(frame)) {
debug_info->ClearStepping();
isolate->debug()->ClearStepping();
isolate->debug()->OnDebugBreak(isolate->factory()->empty_fixed_array());
return undefined;
}
......@@ -630,6 +631,8 @@ RUNTIME_FUNCTION(Runtime_WasmDebugBreak) {
Handle<FixedArray> breakpoints;
if (WasmScript::CheckBreakPoints(isolate, script, position)
.ToHandle(&breakpoints)) {
debug_info->ClearStepping();
isolate->debug()->ClearStepping();
if (isolate->debug()->break_points_active()) {
// We hit one or several breakpoints. Notify the debug listeners.
isolate->debug()->OnDebugBreak(breakpoints);
......
......@@ -52,9 +52,6 @@ Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0xc
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Debugger.resume called
instance.exports.main(4)#
Debugger.resume called
exports.main returned!
Test stepping over a recursive call
......
......@@ -109,8 +109,6 @@ function instantiate(bytes) {
for (let i = 0; i < 3; ++i) await waitForPauseAndStep('stepInto');
// Then just resume.
await waitForPauseAndStep('resume');
// TODO(clemensb/thibaudm): Figure out what this last break is (at ":0:24").
await waitForPauseAndStep('resume');
InspectorTest.log('exports.main returned!');
InspectorTest.log('Test stepping over a recursive call');
......
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