Author: sgje...@chromium.org Date: Wed Jun 17 00:52:50 2009 New Revision: 2198
Modified: wiki/DebuggerProtocol.wiki Log: Edited wiki page through web user interface. Modified: wiki/DebuggerProtocol.wiki ============================================================================== --- wiki/DebuggerProtocol.wiki (original) +++ wiki/DebuggerProtocol.wiki Wed Jun 17 00:52:50 2009 @@ -196,6 +196,89 @@ {"seq":118,"type":"request","command":"frame","arguments":{"number":1}} }}} +== Request `scope` == + +The request scope returns information on a givne scope for a givne frame. If no frame number is specified the selected frame is used. + +{{{ +{ "seq" : <number>, + "type" : "request", + "command" : "scope", + "arguments" : { "number" : <scope number> + "frameNumber" : <frame number, optional uses selected frame if missing> + } +} +}}} + +Response: + +{{{ +{ "seq" : <number>, + "type" : "response", + "request_seq" : <number>, + "command" : "scope", + "body" : { "index" : <index of this scope in the scope chain. Index 0 is the top scope + and the global scope will always have the highest index for a + frame>, + "frameIndex" : <index of the frame>, + "type" : <type of the scope: + 0: Global + 1: Local + 2: With + 3: Closure >, + "object" : <the scope object defining the content of the scope. + For local and closure scopes this is transient objects, + which has a negative handle value> + } + "running" : <is the VM running after sending this response> + "success" : true +} +}}} + +Here are a couple of examples. + +{{{ +{"seq":117,"type":"request","command":"scope"} +{"seq":118,"type":"request","command":"scope","arguments":{"frameNumber":1,"number":1}} +}}} + +== Request `scopes` == + +The request scopes returns all the scopes for a given frame. If no frame number is specified the selected frame is returned. + +{{{ +{ "seq" : <number>, + "type" : "request", + "command" : "scopes", + "arguments" : { "frameNumber" : <frame number, optional uses selected frame if missing> + } +} +}}} + +Response: + +{{{ +{ "seq" : <number>, + "type" : "response", + "request_seq" : <number>, + "command" : "scopes", + "body" : { "fromScope" : <number of first scope in response>, + "toScope" : <number of last scope in response>, + "totalScopes" : <total number of scopes for this frame>, + "scopes" : [ <array of scopes, see request scope above for format> ], + } + "running" : <is the VM running after sending this response> + "success" : true +} +}}} + +Here are a couple of examples. + +{{{ +{"seq":117,"type":"request","command":"scopes"} +{"seq":118,"type":"request","command":"scopes","arguments":{"frameNumber":1}} +}}} + == Request `scripts` == The request `scripts` retrieves active scripts from the VM. An active script is source code from which there is still live objects in the VM. This request will always force a full garbage collection in the VM. @@ -452,6 +535,8 @@ "type" : <"undefined", "null", "boolean", "number", "string", "object", "function" or "frame"> } }}} + +In some situations special transient objects are created by the debugger. These objects are not really visible in from JavaScript, but are created to materialize something inside the VM as an object visible to the debugger. One example of this is the local scope object returned from the `scope` and `scopes` request. Transient objects are identified by having a negative handle. A transient object can never be retrieved using the `lookup` request, so all transient objects referenced will be in the `refs` part of the response. The lifetime of transient objects is basically the request they are involved in. For the primitive JavaScript types `undefined` and `null` the type describes the value fully. --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---