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

Issue 2758483002: [debugger] tuned StepNext and StepOut at return position (Closed)

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

Description

[debugger] tuned StepNext and StepOut at return position Proposed behaviour: - StepNext at return position go into next function call (no changes with current behavior, but implemented in v8::Debug instead of hack on inspector side); - StepOut at return position go into next non-current function call. We need this to have better stepping in cases with native functions, blackboxed functions and/or different embedder calls (e.g. event listeners). New behavior could be illustrated with two examples (for more see stepping-with-natives-and-frameworks test): - let's assume that we've blackboxed callAll function, this function just takes its arguments and call one after another: var foo = () => 1; callAll(foo, foo, () => 2); If we break inside of first call of function foo. Then on.. ..StepNext - we're able to reach second call of function foo, ..StepOut - we're able to reach () => 2 call. - let's consider case with native function: [1,2,3].map(x => x * 2) If we break inside of first callback call, then with StepNext we can iterate through all calls of callback, with StepOut we go to next statement after .map call. Implementation details: - when we request break we schedule step-in function call for any step action at return position and for step-in at any position, - when we request StepOut at return position - we mark current function as needed-to-be-ignored inside of PrepareStepIn(function) call, - when we request StepOut at not return position - we set break at return position and ask debugger to just repeat last step action on next stepping-related break. Design doc: https://docs.google.com/document/d/1ihXHOIhP_q-fJCA0e2EiXz_Zr3B08KMjaPifcaqZ60Q/edit BUG=v8:6118, chromium:583193 R=dgozman@chromium.org,yangguo@chromium.org Review-Url: https://codereview.chromium.org/2758483002 Cr-Commit-Position: refs/heads/master@{#44028} Committed: https://chromium.googlesource.com/v8/v8/+/e27d18c94337f908d75fdccb4c5263180dbb1511

Patch Set 1 #

Total comments: 1

Patch Set 2 : fixed tests #

Patch Set 3 : approach which works #

Patch Set 4 #

Patch Set 5 : more tests #

Total comments: 3

Patch Set 6 : addressed comments #

Total comments: 8

Patch Set 7 : addressed comments #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1003 lines, -8 lines) Patch
M src/debug/debug.h View 1 2 3 4 5 6 2 chunks +8 lines, -1 line 2 comments Download
M src/debug/debug.cc View 1 2 3 4 5 6 10 chunks +45 lines, -4 lines 0 comments Download
M test/cctest/test-debug.cc View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
M test/debugger/debug/es6/debug-stepin-microtasks.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M test/inspector/debugger/framework-stepping-expected.txt View 1 1 chunk +3 lines, -1 line 0 comments Download
A test/inspector/debugger/return-break-locations.js View 1 2 1 chunk +26 lines, -0 lines 0 comments Download
A test/inspector/debugger/return-break-locations-expected.txt View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
A test/inspector/debugger/stepping-tail-call.js View 1 chunk +81 lines, -0 lines 0 comments Download
A test/inspector/debugger/stepping-tail-call-expected.txt View 1 chunk +177 lines, -0 lines 0 comments Download
A test/inspector/debugger/stepping-with-natives-and-frameworks.js View 1 2 3 4 1 chunk +300 lines, -0 lines 0 comments Download
A test/inspector/debugger/stepping-with-natives-and-frameworks-expected.txt View 1 2 3 4 1 chunk +310 lines, -0 lines 0 comments Download
M test/inspector/protocol-test.js View 3 chunks +6 lines, -0 lines 4 comments Download

Messages

Total messages: 29 (16 generated)
kozy
Yang, please take a look. This is implementation of alternative solution from https://docs.google.com/document/d/1ihXHOIhP_q-fJCA0e2EiXz_Zr3B08KMjaPifcaqZ60Q/edit#heading=h.oisrxu9rk226 https://codereview.chromium.org/2758483002/diff/1/src/inspector/v8-debugger-agent-impl.cc File ...
3 years, 9 months ago (2017-03-16 07:19:01 UTC) #1
kozy
Yang and Dmitry, please take a look before meeting on Monday, this CL shows that ...
3 years, 9 months ago (2017-03-18 00:48:06 UTC) #8
Yang
https://codereview.chromium.org/2758483002/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2758483002/diff/80001/src/debug/debug.cc#newcode891 src/debug/debug.cc:891: thread_local_.last_step_action_ = StepIn; We should clear thread_local_.ignore_step_into_function_ here. Otherwise ...
3 years, 9 months ago (2017-03-20 14:29:40 UTC) #12
kozy
all done. https://codereview.chromium.org/2758483002/diff/80001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2758483002/diff/80001/src/debug/debug.cc#newcode891 src/debug/debug.cc:891: thread_local_.last_step_action_ = StepIn; On 2017/03/20 14:29:40, Yang ...
3 years, 9 months ago (2017-03-20 15:52:54 UTC) #13
Yang
https://codereview.chromium.org/2758483002/diff/100001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2758483002/diff/100001/src/debug/debug.cc#newcode423 src/debug/debug.cc:423: v->VisitPointer(&thread_local_.suspended_generator_); You need to iterate ignore_step_into_function_, or otherwise GC ...
3 years, 9 months ago (2017-03-21 13:13:52 UTC) #18
kozy
all done, please take another look. https://codereview.chromium.org/2758483002/diff/100001/src/debug/debug.cc File src/debug/debug.cc (right): https://codereview.chromium.org/2758483002/diff/100001/src/debug/debug.cc#newcode423 src/debug/debug.cc:423: v->VisitPointer(&thread_local_.suspended_generator_); On 2017/03/21 ...
3 years, 9 months ago (2017-03-21 16:03:12 UTC) #19
dgozman
tests and behavior lgtm! https://codereview.chromium.org/2758483002/diff/120001/src/debug/debug.h File src/debug/debug.h (right): https://codereview.chromium.org/2758483002/diff/120001/src/debug/debug.h#newcode569 src/debug/debug.h:569: // If set then this ...
3 years, 9 months ago (2017-03-21 23:33:22 UTC) #20
Yang
lgtm. thanks!
3 years, 9 months ago (2017-03-22 11:56:20 UTC) #21
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/2758483002/120001
3 years, 9 months ago (2017-03-22 13:50:51 UTC) #23
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/v8/v8/+/e27d18c94337f908d75fdccb4c5263180dbb1511
3 years, 9 months ago (2017-03-22 14:16:25 UTC) #26
kozy
oops, addressed reset-related comments in separate CL: https://codereview.chromium.org/2767873002/ https://codereview.chromium.org/2758483002/diff/120001/test/inspector/protocol-test.js File test/inspector/protocol-test.js (right): https://codereview.chromium.org/2758483002/diff/120001/test/inspector/protocol-test.js#newcode10 test/inspector/protocol-test.js:10: InspectorTest._commandToLog ...
3 years, 9 months ago (2017-03-22 17:09:46 UTC) #27
kozy
s/reset/tests/
3 years, 9 months ago (2017-03-22 17:10:10 UTC) #28
kozy
3 years, 9 months ago (2017-03-22 17:19:53 UTC) #29
Message was sent while issue was closed.
correct link to followup CL: https://codereview.chromium.org/2766283002#

https://codereview.chromium.org/2758483002/diff/120001/src/debug/debug.h
File src/debug/debug.h (right):

https://codereview.chromium.org/2758483002/diff/120001/src/debug/debug.h#newc...
src/debug/debug.h:569: // If set then this function will be ignored in
PrepareStepIn call.
On 2017/03/21 23:33:21, dgozman wrote:
> If set, next PrepareStepIn will ignore this function until stepped into
another
> function, at which point this will be cleared.

Done.

Powered by Google App Engine
This is Rietveld 408576698