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

Issue 2655253004: [inspector] introduced stepIntoAsync for chained callbacks (Closed)

Created:
3 years, 10 months ago by kozy
Modified:
3 years, 9 months ago
Reviewers:
dgozman, Yang
CC:
v8-reviews_googlegroups.com, devtools-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[inspector] introduced stepIntoAsync for chained callbacks Introduced: - break location before each .then call if scheduled action is stepInto, - Debugger.stepIntoAsync method which schedules break at the entry to chained callback, - "stepIntoAsyncAvailable" property inside of data argument of Debugger.paused notification, this flag is true for break location before Promise.then. BUG=chromium:432469 R=yangguo@chromium.org,dgozman@chromium.org

Patch Set 1 : PoC #

Total comments: 8

Patch Set 2 : added is_breakable into PromiseCreatedEvent #

Total comments: 4

Patch Set 3 : addressed Yang's comment #

Total comments: 5

Patch Set 4 : async-step-into for promise.then #

Patch Set 5 : ready for review #

Patch Set 6 : added a test #

Patch Set 7 : .. #

Patch Set 8 : a little better approach #

Patch Set 9 : fixed async/await and added tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+703 lines, -63 lines) Patch
M src/api.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -8 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -4 lines 0 comments Download
M src/debug/debug.h View 1 2 3 4 3 chunks +7 lines, -3 lines 0 comments Download
M src/debug/debug.cc View 1 2 3 4 4 chunks +30 lines, -8 lines 0 comments Download
M src/debug/debug-interface.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M src/inspector/js_protocol.json View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/inspector/v8-debugger.h View 1 2 3 4 5 6 7 8 4 chunks +14 lines, -2 lines 0 comments Download
M src/inspector/v8-debugger.cc View 1 2 3 4 5 6 7 8 9 chunks +84 lines, -24 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.h View 1 2 3 3 chunks +4 lines, -2 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.cc View 1 2 3 4 5 6 7 5 chunks +24 lines, -10 lines 0 comments Download
M src/js/promise.js View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime/runtime-debug.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
A test/inspector/debugger/step-into-async.js View 1 2 3 4 5 6 7 8 1 chunk +164 lines, -0 lines 0 comments Download
A test/inspector/debugger/step-into-async-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +332 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (5 generated)
kozy
Inspector part contains implementation of two parts: - how we can break at the moment ...
3 years, 10 months ago (2017-01-27 20:54:58 UTC) #5
dgozman
I guess most of the questions are for Yang, but here are my thoughts: - ...
3 years, 10 months ago (2017-01-27 23:59:22 UTC) #6
kozy
Uploaded to this CL fix for redundant asyncTaskCreated events from Promise.all and Promise.race. They occur ...
3 years, 10 months ago (2017-01-28 00:12:42 UTC) #7
kozy
I think that problem with stepping over assignment with more then one functions call is ...
3 years, 10 months ago (2017-01-28 21:36:10 UTC) #8
Yang
https://codereview.chromium.org/2655253004/diff/60001/src/debug/debug.h File src/debug/debug.h (right): https://codereview.chromium.org/2655253004/diff/60001/src/debug/debug.h#newcode629 src/debug/debug.h:629: bool non_breakable_async_events_; Can we have a comment here? https://codereview.chromium.org/2655253004/diff/60001/src/js/promise.js ...
3 years, 10 months ago (2017-01-30 13:30:15 UTC) #9
kozy
Yang, could you take a look on other points in comments to this CL? https://codereview.chromium.org/2655253004/diff/60001/src/debug/debug.h ...
3 years, 10 months ago (2017-01-30 16:58:00 UTC) #10
Yang
LGTM. Though I'm not familiar enough with the inspector so please wait for Dmitry's comments. ...
3 years, 10 months ago (2017-01-30 19:40:34 UTC) #11
Yang
https://codereview.chromium.org/2655253004/diff/40001/test/inspector/debugger/async-step-into-for-promise-expected.txt File test/inspector/debugger/async-step-into-for-promise-expected.txt (right): https://codereview.chromium.org/2655253004/diff/40001/test/inspector/debugger/async-step-into-for-promise-expected.txt#newcode3 test/inspector/debugger/async-step-into-for-promise-expected.txt:3: Running test: testPromiseThen On 2017/01/27 20:54:58, kozy wrote: > ...
3 years, 10 months ago (2017-01-30 20:04:32 UTC) #12
Yang
On 2017/01/27 20:54:58, kozy wrote: > Inspector part contains implementation of two parts: > - ...
3 years, 10 months ago (2017-01-31 08:43:48 UTC) #13
kozy
On 2017/01/31 08:43:48, Yang wrote: > On 2017/01/27 20:54:58, kozy wrote: > > Inspector part ...
3 years, 10 months ago (2017-01-31 16:22:05 UTC) #14
kozy
Dmitry and Yang, please take a look! https://codereview.chromium.org/2655253004/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2655253004/diff/80001/src/debug/debug.cc#newcode1953 src/debug/debug.cc:1953: if (!frame->HasInlinedFrames()) ...
3 years, 10 months ago (2017-02-15 01:00:54 UTC) #16
kozy
Frontend part: https://codereview.chromium.org/2696253002
3 years, 10 months ago (2017-02-15 21:48:03 UTC) #17
kozy
3 years, 10 months ago (2017-02-17 16:52:44 UTC) #18
Most issues which we found yesterday are fixed.
One left: you need to make additional stepInto after stepOut from constructor or
in case of createPromise().then(foo). Looks big enough to think about
alternatives.
1. We can break in .then only when current stepping action is stepOver.
Advantage: always easy to go to next .then callback - you don't need to do
stepInto createPromise function and then press stepOut, just one click to
stepOver.
Disadvantage: stepOver will break more often then stepInto on expression like
promise.then(..).then(..).then(..).

2. We can introduce break location before function call and report
function-about-to-be-called in v8::Break event. It'll solve all use cases
including setTimeout. I'll try to do it today.

I think that ideal solution is some mix of 1 and 2. We report function
about-to-be-called in v8::Break and tune break location in expression like
createPromise().then(..).then(..). Additionally we add break before .then calls
during stepOver action to provide easy way to go to inspected chained callback.

Powered by Google App Engine
This is Rietveld 408576698