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

Issue 1500933002: [debugger] fix debug-evaluate wrt shadowed context var. (Closed)

Created:
5 years ago by Yang
Modified:
5 years ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[debugger] fix debug-evaluate wrt shadowed context var. Debug-evaluate used to resolve stack variables that shadow context variables incorrectly, since the stack variable is not visible in the context chain. To fix this, we limit local variables accessible by debug- evaluate to the ones directly referenced inside the function. What is not referenced by the function itself, is considered optimized out and not accessible by debug-evaluate. To achieve this, we duplicate the entire context chain up to the native context, and write back changes after debug- evaluate. Changes to the original context chain will however be overwritten. This already happens for catch and block scopes though. Also fix a crash caused by declaring variables inside debug- evaluate. R=mstarzinger@chromium.org BUG=v8:4593 LOG=N Committed: https://crrev.com/089edbfa97eab324bc463829ea03c167fdc6d45c Cr-Commit-Position: refs/heads/master@{#32828}

Patch Set 1 #

Total comments: 1

Patch Set 2 : reimplement #

Patch Set 3 : third attempt at this #

Patch Set 4 : test case #

Total comments: 1

Patch Set 5 : skip script context #

Patch Set 6 : fix tests #

Patch Set 7 : fix declaration inside debug-evaluate #

Patch Set 8 : fix failures #

Patch Set 9 : add TODO #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+534 lines, -115 lines) Patch
M src/ast/scopes.h View 1 2 2 chunks +3 lines, -0 lines 1 comment Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 1 chunk +18 lines, -0 lines 0 comments Download
M src/debug/debug-evaluate.h View 1 2 3 4 5 6 7 1 chunk +18 lines, -2 lines 0 comments Download
M src/debug/debug-evaluate.cc View 1 2 3 4 5 6 7 7 chunks +132 lines, -51 lines 0 comments Download
M src/debug/debug-frames.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/debug/debug-scopes.h View 1 2 4 chunks +22 lines, -2 lines 0 comments Download
M src/debug/debug-scopes.cc View 1 2 7 chunks +64 lines, -30 lines 0 comments Download
M src/runtime/runtime-debug.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/test-debug.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -6 lines 0 comments Download
M test/mjsunit/debug-evaluate-closure.js View 1 2 2 chunks +7 lines, -4 lines 0 comments Download
A test/mjsunit/debug-evaluate-declaration.js View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
M test/mjsunit/debug-evaluate-locals.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A + test/mjsunit/debug-evaluate-modify-catch-block-scope.js View 1 2 3 4 5 1 chunk +18 lines, -16 lines 0 comments Download
A test/mjsunit/debug-evaluate-shadowed-context.js View 1 2 3 4 5 1 chunk +82 lines, -0 lines 0 comments Download
A test/mjsunit/es6/debug-evaluate-arrow-function-receiver.js View 1 2 1 chunk +116 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (10 generated)
Yang
5 years ago (2015-12-04 11:24:44 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1500933002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1500933002/1
5 years ago (2015-12-07 08:04:51 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-07 08:26:30 UTC) #5
Yang
On 2015/12/07 08:26:30, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
5 years ago (2015-12-07 10:32:22 UTC) #6
Michael Starzinger
https://codereview.chromium.org/1500933002/diff/1/src/debug/debug-evaluate.cc File src/debug/debug-evaluate.cc (right): https://codereview.chromium.org/1500933002/diff/1/src/debug/debug-evaluate.cc#newcode278 src/debug/debug-evaluate.cc:278: while (!context->IsNativeContext() && !context->IsScriptContext()) { This iteration seems to ...
5 years ago (2015-12-07 10:42:57 UTC) #7
Michael Starzinger
LGTM.
5 years ago (2015-12-07 10:53:56 UTC) #8
Yang
On 2015/12/07 10:53:56, Michael Starzinger wrote: > LGTM. The old approach did not work because ...
5 years ago (2015-12-08 13:19:45 UTC) #9
Yang
Andreas, do you want to take a look at this?
5 years ago (2015-12-08 13:20:05 UTC) #11
rossberg
On 2015/12/08 13:20:05, Yang wrote: > Andreas, do you want to take a look at ...
5 years ago (2015-12-08 17:09:17 UTC) #12
Yang
On 2015/12/08 17:09:17, rossberg wrote: > On 2015/12/08 13:20:05, Yang wrote: > > Andreas, do ...
5 years ago (2015-12-08 17:43:50 UTC) #13
rossberg
On 2015/12/08 17:43:50, Yang wrote: > On 2015/12/08 17:09:17, rossberg wrote: > > On 2015/12/08 ...
5 years ago (2015-12-08 17:46:47 UTC) #14
Yang
On 2015/12/08 17:46:47, rossberg wrote: > On 2015/12/08 17:43:50, Yang wrote: > > On 2015/12/08 ...
5 years ago (2015-12-08 18:10:26 UTC) #15
rossberg
On 2015/12/08 18:10:26, Yang wrote: > On 2015/12/08 17:46:47, rossberg wrote: > > On 2015/12/08 ...
5 years ago (2015-12-09 08:48:40 UTC) #16
Yang
On 2015/12/09 08:48:40, rossberg wrote: > On 2015/12/08 18:10:26, Yang wrote: > > On 2015/12/08 ...
5 years ago (2015-12-09 14:47:02 UTC) #17
rossberg
https://codereview.chromium.org/1500933002/diff/60001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/1500933002/diff/60001/src/ast/scopes.cc#newcode847 src/ast/scopes.cc:847: for (int i = 0; i < unresolved_.length(); i++) ...
5 years ago (2015-12-09 14:53:47 UTC) #18
Yang
On 2015/12/09 14:53:47, rossberg wrote: > https://codereview.chromium.org/1500933002/diff/60001/src/ast/scopes.cc > File src/ast/scopes.cc (right): > > https://codereview.chromium.org/1500933002/diff/60001/src/ast/scopes.cc#newcode847 > ...
5 years ago (2015-12-09 15:15:09 UTC) #19
Yang
On 2015/12/09 15:15:09, Yang wrote: > On 2015/12/09 14:53:47, rossberg wrote: > > https://codereview.chromium.org/1500933002/diff/60001/src/ast/scopes.cc > ...
5 years ago (2015-12-10 09:08:47 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1500933002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1500933002/140001
5 years ago (2015-12-10 11:18:10 UTC) #24
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-10 11:53:25 UTC) #26
Yang
On 2015/12/10 11:53:25, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
5 years ago (2015-12-10 13:06:39 UTC) #27
Yang
On 2015/12/10 13:06:39, Yang wrote: > On 2015/12/10 11:53:25, commit-bot: I haz the power wrote: ...
5 years ago (2015-12-11 11:57:39 UTC) #28
rossberg
Thanks for the TODO. LGTM until we have something better :)
5 years ago (2015-12-11 12:01:21 UTC) #29
Michael Starzinger
LGTM as an interim solution. https://codereview.chromium.org/1500933002/diff/160001/src/ast/scopes.h File src/ast/scopes.h (right): https://codereview.chromium.org/1500933002/diff/160001/src/ast/scopes.h#newcode9 src/ast/scopes.h:9: #include "src/hashmap.h" nit: The ...
5 years ago (2015-12-11 14:35:12 UTC) #30
Yang
On 2015/12/11 14:35:12, Michael Starzinger wrote: > LGTM as an interim solution. > > https://codereview.chromium.org/1500933002/diff/160001/src/ast/scopes.h ...
5 years ago (2015-12-14 09:46:57 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1500933002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1500933002/160001
5 years ago (2015-12-14 09:48:16 UTC) #33
Michael Starzinger
On 2015/12/14 09:46:57, Yang wrote: > On 2015/12/11 14:35:12, Michael Starzinger wrote: > > LGTM ...
5 years ago (2015-12-14 09:49:57 UTC) #34
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years ago (2015-12-14 10:24:41 UTC) #36
commit-bot: I haz the power
5 years ago (2015-12-14 10:25:21 UTC) #38
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/089edbfa97eab324bc463829ea03c167fdc6d45c
Cr-Commit-Position: refs/heads/master@{#32828}

Powered by Google App Engine
This is Rietveld 408576698