Inspector protocol should expose function scopes as Debugger.Scope type |
|||
Issue description
The inspector protocol currently has basic support for inspecting scopes of functions not currently on the call stack through Runtime.getProperties and the internal '[[Scopes]]' value:
{
"result": {
"internalProperties": [
{
"name": "[[Scopes]]",
"value": {
"className": "Array",
"description": "Scopes[3]",
"objectId": "{\"injectedScriptId\":1,\"id\":15}",
"subtype": "internal#scopeList",
"type": "object"
}
}
],
"result": [
[...]
]
}
}
One element of this array:
{
[...],
"name": "0",
"value": {
"className": "Object",
"description": "Closure (gen1)",
"objectId": "{\"injectedScriptId\":1,\"id\":258}",
"subtype": "internal#scope",
"type": "object"
},
"writable": true
}
In contrast to the Debugger.Scope type (defined in js_protocol.json and used in Debugger.CallFrames during the Debugger.paused event), this format lacks a well-defined type ("script", "global", ...), startLocation and endLocation.
It would be nice to expose these scopes as the Debugger.Scope type.
,
Nov 21 2016
We specifically did it this way, since it fits internal properties quite well, and is not important enough functionality to justify extra protocol methods/types. Do you have a usecase in mind except for unification with scopes on pause?
,
Nov 22 2016
My own personal use-case is that accessing function/suspended generator scopes through our new internal debug-wrapper in test/debugger/test-api.js would be much cleaner if they had the same format as scopes on pause. I guess I don't care too much either way though since the current implementation in test-api.js (which accesses suspended generator scopes through runtime functions) just works. Feel free to close if you don't feel this is necessary.
,
Nov 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5928ab42599d65e34760a6c4081fcbf919f8c641 commit 5928ab42599d65e34760a6c4081fcbf919f8c641 Author: jgruber <jgruber@chromium.org> Date: Tue Nov 22 16:02:53 2016 Mark function-generator-details as NeedsManualRebaseline BUG= chromium:667286 Review-Url: https://codereview.chromium.org/2521823004 Cr-Commit-Position: refs/heads/master@{#433877} [modify] https://crrev.com/5928ab42599d65e34760a6c4081fcbf919f8c641/third_party/WebKit/LayoutTests/TestExpectations
,
Nov 24 2016
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc commit f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc Author: jgruber <jgruber@chromium.org> Date: Thu Nov 24 07:32:25 2016 [inspector] Expose scopes for suspended generator objects This exposes scopes for suspended generator objects by adding a [[Scopes]] internal property to generator objects, similar to how scopes for functions currently not on the stack are handled. BUG= chromium:667286 Review-Url: https://codereview.chromium.org/2516973003 Cr-Commit-Position: refs/heads/master@{#41244} [modify] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/src/inspector/debugger-script.js [modify] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/src/inspector/debugger_script_externs.js [modify] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/src/inspector/v8-debugger.cc [modify] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/src/inspector/v8-debugger.h [add] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/test/inspector/debugger/suspended-generator-scopes-expected.txt [add] https://crrev.com/f0d3cf5baeb9df05c29dafa1b1840eb0595d7abc/test/inspector/debugger/suspended-generator-scopes.js
,
Dec 2 2016
,
Dec 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d13f0d91b1f707e76dd475be962b5813ab7e764b commit d13f0d91b1f707e76dd475be962b5813ab7e764b Author: jgruber <jgruber@chromium.org> Date: Thu Dec 22 13:03:47 2016 Mark function-generator-details as NeedsRebaseline The relevant change to display scopes for suspended generator objects has now landed in V8. BUG= chromium:667286 Review-Url: https://codereview.chromium.org/2594203003 Cr-Commit-Position: refs/heads/master@{#440398} [modify] https://crrev.com/d13f0d91b1f707e76dd475be962b5813ab7e764b/third_party/WebKit/LayoutTests/TestExpectations
,
Dec 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/322ca4742814e7d5da25dd1bd19f6ff0d4b6d229 commit 322ca4742814e7d5da25dd1bd19f6ff0d4b6d229 Author: Rebaseline Bot <blink-rebaseline-bot@chromium.org> Date: Thu Dec 22 17:10:42 2016 Auto-rebaseline for r440398 https://chromium.googlesource.com/chromium/src/+/d13f0d91b1f70 BUG= 667286 TBR=jgruber@chromium.org Review-Url: https://codereview.chromium.org/2599083002 . Cr-Commit-Position: refs/heads/master@{#440444} [modify] https://crrev.com/322ca4742814e7d5da25dd1bd19f6ff0d4b6d229/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/322ca4742814e7d5da25dd1bd19f6ff0d4b6d229/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/function-generator-details-expected.txt |
|||
►
Sign in to add a comment |
|||
Comment 1 by jgruber@chromium.org
, Nov 21 2016