Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Issue 2649533002: [wasm] Implement stepping in wasm code (Closed)

Created:
3 years, 11 months ago by Clemens Hammacher
Modified:
3 years, 11 months ago
Reviewers:
titzer, Yang
CC:
v8-reviews_googlegroups.com, Yang
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Implement stepping in wasm code Implement stepping by remembering the current step action in the wasm interpreter handle in WasmDebugInfo, and using it when continuing execution in the interpreter. The control flow is as follows: After module compilation, the user sets a breakpoint in wasm. The respective function is redirected to the interpreter and the breakpoint is set on the interpreter. When it is hit, we notify all debug event listeners, which might prepare stepping. When returning from these listeners, before continuing execution, we check whether stepping was requested and continue execution in the interpreter accordingly. Stepping from Wasm to JS and vice versa will be implemented and tested in a follow-up CL. Testing this requires breakpoints and stepping in Wasm to be exposed via the inspector interface, such that we can write an inspector test. This mixed JS-Wasm-execution is hard to set up in a cctest. R=titzer@chromium.org, yangguo@chromium.org BUG= Review-Url: https://codereview.chromium.org/2649533002 Cr-Commit-Position: refs/heads/master@{#42624} Committed: https://chromium.googlesource.com/v8/v8/+/3dea55b41379a606d7a1f5f33bbdda69e440f2b6

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Fix win compile error #

Patch Set 4 : Add TODOs #

Total comments: 12

Patch Set 5 : Rebase to Yangs CL and address Ben's comments #

Total comments: 3

Patch Set 6 : Move condition and code into loop #

Patch Set 7 : Rearrange code inside the loop #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+300 lines, -88 lines) Patch
M src/compiler/wasm-compiler.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -2 lines 0 comments Download
M src/debug/debug.cc View 1 2 3 4 5 6 7 4 chunks +37 lines, -18 lines 0 comments Download
M src/frames.h View 2 chunks +1 line, -2 lines 0 comments Download
M src/frames.cc View 1 chunk +0 lines, -10 lines 0 comments Download
M src/runtime/runtime-debug.cc View 3 chunks +10 lines, -6 lines 0 comments Download
M src/wasm/wasm-debug.cc View 1 2 3 4 8 chunks +90 lines, -23 lines 0 comments Download
M src/wasm/wasm-interpreter.h View 1 2 chunks +10 lines, -0 lines 0 comments Download
M src/wasm/wasm-interpreter.cc View 1 2 3 4 5 6 7 13 chunks +28 lines, -17 lines 0 comments Download
M src/wasm/wasm-objects.h View 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/wasm/test-wasm-breakpoints.cc View 1 2 3 4 7 chunks +118 lines, -10 lines 0 comments Download

Messages

Total messages: 46 (37 generated)
Clemens Hammacher
3 years, 11 months ago (2017-01-20 16:37:19 UTC) #16
titzer
https://codereview.chromium.org/2649533002/diff/60001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2649533002/diff/60001/src/debug/debug.cc#newcode997 src/debug/debug.cc:997: if (frame->is_wasm()) { How do we know that this ...
3 years, 11 months ago (2017-01-23 10:10:10 UTC) #19
Clemens Hammacher
Rebased on Yang's latest CL. PTAL https://codereview.chromium.org/2649533002/diff/60001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2649533002/diff/60001/src/debug/debug.cc#newcode997 src/debug/debug.cc:997: if (frame->is_wasm()) { ...
3 years, 11 months ago (2017-01-23 12:25:34 UTC) #24
Yang
src/debug lgtm. https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc#newcode1084 src/debug/debug.cc:1084: // TODO(clemensh): Implement stepping from JS into ...
3 years, 11 months ago (2017-01-23 14:26:20 UTC) #25
titzer
lgtm https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc#newcode1049 src/debug/debug.cc:1049: while (!frames_it.done()) { As per previous comment, mind ...
3 years, 11 months ago (2017-01-23 18:30:46 UTC) #26
Clemens Hammacher
https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2649533002/diff/80001/src/debug/debug.cc#newcode1049 src/debug/debug.cc:1049: while (!frames_it.done()) { On 2017/01/23 at 18:30:45, titzer wrote: ...
3 years, 11 months ago (2017-01-23 18:47:27 UTC) #29
Clemens Hammacher
As discussed offline, I rearranged the code in the loop, it's much shorter now. Landing ...
3 years, 11 months ago (2017-01-24 09:45:20 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2649533002/140001
3 years, 11 months ago (2017-01-24 10:11:16 UTC) #43
commit-bot: I haz the power
3 years, 11 months ago (2017-01-24 10:13:42 UTC) #46
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/v8/v8/+/3dea55b41379a606d7a1f5f33bbdda69e44...

Powered by Google App Engine
This is Rietveld 408576698