• sgjesse@chromium.org's avatar
    Add scope chain information to the debugger. · 88261439
    sgjesse@chromium.org authored
    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
    Review URL: http://codereview.chromium.org/123021
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    88261439
d8.js 43.7 KB