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

Issue 2748503002: [inspector] changed a way of preserving stepping between tasks (Closed)

Created:
3 years, 9 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/heads/master
Project:
v8
Visibility:
Public.

Description

[inspector] changed a way of preserving stepping between tasks Indisputable profit: - correct break location in next task (see tests), - stepOver with async await never lands in random code (see related test and issue), - inspector doesn't store current stepping state in debugger agent and completely trust V8 - step to new inspector-V8 design (I will finish design doc soon). - willExecuteScript and didExecuteScript instrumentation could be removed from code base - reduce probability of future errors. - finally - less code, - stepping implementation in V8 makes another step to follow our stepping strategy (stepOut should do stepInto and break when exit current frame) (another one one page design doc based on @aandrey comment is coming), - knowledge about existing of context groups is still inspector-only. Disputable part is related to super rare scenario when in single isolate we have more then one context group id with enabled debugger agent: - if one agent request break in own context (stepping, pause, e.t.c.) then we ignore all breaks in another agent. From one hand it looks like good: user clicks stepInto and they don't expect that execution could be paused by another instance of DevTools in unobservable from current DevTools way (second DevTools will get paused notification and run nested message loop). From another hand we shouldn't ignore breakpoints or debugger statement never. In general, I think that proposed behavior is rathe feature then issue. - and disadvantage, on attempt to break in non-target context group id we just call StepOut until reach target context group id, step out call could deoptimize code in non related to current debugger agent context. But break could happens only in case of debugger stmt or breakpoint - sound like minor issue. Ignoring break on exception sounds like real issue but by module of rareness of this case I think we can ignore this. Implementation details: - when debugger agent request break for any reason it passes target context group id to V8Debugger - last agent requesting break is preferred. - when V8Debugger gets BreakProgramRequested notification from V8, it checks current context group id against target context group id, if they match then just process break as usual otherwise makes StepOut action, - debug.cc at the end of microtask if last_scheduled_action is StepOut, schedules StepIn and will break on first instruction in next task. BUG=chromium:654022 R=dgozman@chromium.org,yangguo@chromium.org Review-Url: https://codereview.chromium.org/2748503002 Cr-Commit-Position: refs/heads/master@{#44034} Committed: https://chromium.googlesource.com/v8/v8/+/760c56bddfd120b3a1f4cda21757702e4d3dc4d7

Patch Set 1 #

Patch Set 2 : who needs these lines? let's remove more! #

Patch Set 3 : the cherry on the cake #

Patch Set 4 : added a bunch of DCHECKs #

Patch Set 5 : removed willExecuteScript from tests #

Total comments: 10

Patch Set 6 : addressed comments #

Patch Set 7 : fixed test #

Patch Set 8 : rebased on tunned stepping at return #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -251 lines) Patch
M src/inspector/v8-console.cc View 1 2 3 4 5 1 chunk +5 lines, -3 lines 0 comments Download
M src/inspector/v8-debugger.h View 1 2 chunks +6 lines, -4 lines 0 comments Download
M src/inspector/v8-debugger.cc View 1 2 3 5 chunks +27 lines, -5 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.h View 1 2 3 4 5 4 chunks +0 lines, -11 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.cc View 1 2 3 4 5 6 7 10 chunks +12 lines, -64 lines 0 comments Download
M src/inspector/v8-inspector-impl.h View 1 2 3 4 5 2 chunks +0 lines, -16 lines 0 comments Download
M src/inspector/v8-inspector-impl.cc View 1 2 3 4 5 2 chunks +0 lines, -54 lines 0 comments Download
M src/inspector/v8-runtime-agent-impl.cc View 1 2 3 4 5 4 chunks +19 lines, -8 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 lines 0 comments Download
M test/inspector/debugger/doesnt-step-into-injected-script.js View 1 chunk +20 lines, -25 lines 0 comments Download
M test/inspector/debugger/doesnt-step-into-injected-script-expected.txt View 1 chunk +16 lines, -16 lines 0 comments Download
M test/inspector/debugger/step-into-expected.txt View 1 chunk +0 lines, -15 lines 0 comments Download
M test/inspector/debugger/step-into-next-script-expected.txt View 3 chunks +3 lines, -15 lines 0 comments Download
A test/inspector/debugger/step-over-another-context-group.js View 1 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
A test/inspector/debugger/step-over-another-context-group-expected.txt View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M test/inspector/debugger/stepping-after-get-possible-breakpoints-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M test/inspector/inspector-test.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M test/inspector/runtime/create-context-expected.txt View 2 chunks +2 lines, -4 lines 0 comments Download
M test/inspector/task-runner.cc View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 25 (18 generated)
kozy
Dmitry and Yang, I think you will love this CL, please take a look. Roadmap: ...
3 years, 9 months ago (2017-03-11 01:22:22 UTC) #2
Yang
On 2017/03/11 01:22:22, kozy wrote: > Dmitry and Yang, I think you will love this ...
3 years, 9 months ago (2017-03-13 12:32:12 UTC) #4
dgozman
https://codereview.chromium.org/2748503002/diff/80001/src/inspector/v8-debugger-agent-impl.h File src/inspector/v8-debugger-agent-impl.h (right): https://codereview.chromium.org/2748503002/diff/80001/src/inspector/v8-debugger-agent-impl.h#newcode179 src/inspector/v8-debugger-agent-impl.h:179: enum DebuggerStep { NoStep = 0, StepInto, StepOver, StepOut ...
3 years, 9 months ago (2017-03-13 17:31:33 UTC) #5
kozy
all done, please take another look! https://codereview.chromium.org/2748503002/diff/80001/src/inspector/v8-debugger-agent-impl.h File src/inspector/v8-debugger-agent-impl.h (right): https://codereview.chromium.org/2748503002/diff/80001/src/inspector/v8-debugger-agent-impl.h#newcode179 src/inspector/v8-debugger-agent-impl.h:179: enum DebuggerStep { ...
3 years, 9 months ago (2017-03-14 01:30:14 UTC) #6
dgozman
lgtm
3 years, 9 months ago (2017-03-14 17:21:20 UTC) #15
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/2748503002/140001
3 years, 9 months ago (2017-03-22 16:19:39 UTC) #22
commit-bot: I haz the power
3 years, 9 months ago (2017-03-22 16:21:01 UTC) #25
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/v8/v8/+/760c56bddfd120b3a1f4cda21757702e4d3...

Powered by Google App Engine
This is Rietveld 408576698