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

Issue 123021: Add scope chain information to the debugger (Closed)

Created:
11 years, 6 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add scope chain information to the debugger. For each frame it is now possible to request information on the scope chain. Each scope in the chain can have one of the types local, global, with and closure. For scopes of type global and with the mirror for the actual global or with object is available. For scopes of type local and closure a plain JavaScript object with the materialized content of the scope is created and its mirror is returned. Depending on the level of possible optimization the content of the materialized local and closure scopes might only contain the names which are actually used. To iterate the scope chain an iterator ScopeIterator have been added which can provide the type of each scope for each part of the chain. This iterator creates an artificial local scope whenever that is present as the context chain does not include the local scope. To avoid caching the mirror objects for the materialized the local and closure scopes transient mirrors have been added. They have negative handles and cannot be retrieved by subsequent lookup calls. Their content is part of a single response. For debugging purposes an additional runtime function DebugPrintScopes is been added. Added commands 'scopes' and 'scope' to the developer shell and fixed the dir command. BUG=none TEST=test/mjsunit/debug-scopes.js Committed: http://code.google.com/p/v8/source/detail?r=2149

Patch Set 1 #

Total comments: 13

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1411 lines, -68 lines) Patch
M src/d8.js View 10 chunks +114 lines, -7 lines 0 comments Download
M src/debug-delay.js View 1 3 chunks +66 lines, -1 line 0 comments Download
M src/mirror-delay.js View 1 18 chunks +156 lines, -18 lines 0 comments Download
M src/runtime.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 3 chunks +412 lines, -42 lines 0 comments Download
A test/mjsunit/debug-scopes.js View 1 chunk +660 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Søren Thygesen Gjesse
11 years, 6 months ago (2009-06-11 14:55:22 UTC) #1
Mads Ager (chromium)
11 years, 6 months ago (2009-06-12 08:01:14 UTC) #2
LGTM

http://codereview.chromium.org/123021/diff/1/7
File src/debug-delay.js (right):

http://codereview.chromium.org/123021/diff/1/7#newcode1564
Line 1564: // Get the selected frame. With no frame argument use the selected
frame.
Could you change one of the occurrences of selected in this comment to something
else to make it less confusing?

http://codereview.chromium.org/123021/diff/1/7#newcode1597
Line 1597: // Get the selected frame. With no frame argument use the selected
frame.
Ditto.

http://codereview.chromium.org/123021/diff/1/7#newcode1599
Line 1599: if (request.arguments &&
!IS_UNDEFINED(request.arguments.frameNumber)) {
Factor out this code out since it is shared by 'scope' and 'scopes' requests.

http://codereview.chromium.org/123021/diff/1/5
File src/mirror-delay.js (right):

http://codereview.chromium.org/123021/diff/1/5#newcode431
Line 431: *    transient handle..
Two periods.  The other param comments have no periods.

http://codereview.chromium.org/123021/diff/1/5#newcode572
Line 572: *    transient handle..
Ditto.

http://codereview.chromium.org/123021/diff/1/5#newcode1650
Line 1650: * @param {Object} data The context data
The param comment does not match the function.

http://codereview.chromium.org/123021/diff/1/5#newcode1680
Line 1680: // created on the fly or materializing the local and closure scopes
and
Remove 'or'?

http://codereview.chromium.org/123021/diff/1/3
File src/runtime.cc (right):

http://codereview.chromium.org/123021/diff/1/3#newcode6114
Line 6114: ScopeInfo<> sinfo(*code);
Spell out scope: sinfo -> scope_info?

http://codereview.chromium.org/123021/diff/1/3#newcode6176
Line 6176: ScopeInfo<> sinfo(*code);
scope_info?

http://codereview.chromium.org/123021/diff/1/3#newcode6178
Line 6178: // Allocate and initialize a JSObject with all the XXX.
XXX -> real comment

http://codereview.chromium.org/123021/diff/1/3#newcode6200
Line 6200: // Fill all context locals to the context extension.
It seems that the rest of this could be factored out shared with Materialize
local scope?

http://codereview.chromium.org/123021/diff/1/3#newcode6269
Line 6269: // If at the local scope mark the local scope as passed.
the local scope -> a local scope?

http://codereview.chromium.org/123021/diff/1/3#newcode6274
Line 6274: // If the current context is not associated with the local scope that
is
that is -> the current context is?

Powered by Google App Engine
This is Rietveld 408576698