Remote Debugging Protocol: Difference between revisions

Jump to navigation Jump to search
→‎Listing Stack Frames: Merge "host" frames with "call" frames. Reconcile with current JSInspector.Frame behavior.
(→‎Interacting with Thread-Like Actors: Stray text: attaching pauses a thread.)
(→‎Listing Stack Frames: Merge "host" frames with "call" frames. Reconcile with current JSInspector.Frame behavior.)
Line 619: Line 619:


   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
     "type":<i>type</i>, ... }
     "type":<i>type</i>, "this":<i>this</i>, ... }


where:
where:
Line 625: Line 625:
* <i>actor</i> is the name of an actor representing this frame;
* <i>actor</i> is the name of an actor representing this frame;
* <i>depth</i> is the number of this frame, starting with zero for the youngest frame on the stack;
* <i>depth</i> is the number of this frame, starting with zero for the youngest frame on the stack;
* <i>id</i> is a unique number assigned to this stack frame, to help the client identify frames across pauses; and
* <i>id</i> is a unique number assigned to this stack frame, to help the client identify frames across pauses;
* <i>type</i> is a string indicating what sort of frame this is.
* <i>type</i> is a string indicating what sort of frame this is; and
* <i>this</i> is a grip on the value of <tt>this</tt> for this call.


The frame may have other properties, depending on <i>type</i>.
The frame may have other properties, depending on <i>type</i>.
Line 637: Line 638:


   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
     "type":"global", "where":<i>location</i>, "environment":<i>environment</i> }
     "type":"global", "this":<i>this</i>,
    "where":<i>location</i>, "environment":<i>environment</i> }


where:
where:
Line 651: Line 653:


   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
     "type":"call", "where":<i>location</i>, "environment",<i>environment</i>,
     "type":"call", "this":<i>this</i>,
     "callee":<i>callee</i>, "callee-name":<i>callee-name</i>, "this":<i>this</i>, "arguments":<i>arguments</i> }
    "where":<i>location</i>, "environment",<i>environment</i>,
     "callee":<i>callee</i>, "callee-name":<i>callee-name</i>, "arguments":<i>arguments</i> }


where:
where:


* <i>where</i> is the current point of execution within the callee;
* <i>callee</i> is a grip on the function value being called;
* <i>callee</i> is a grip on the function value being called;
* <i>callee-name</i> is the name of the callee, a string (this property is omitted for anonymous functions);
* <i>callee-name</i> is the name of the callee, a string (this property is omitted for anonymous functions);
* <i>this</i> is a grip on the value of <tt>this</tt> for this call;
* <i>arguments</i> is an array of grips on the actual values passed to the function;
* <i>arguments</i> is an array of grips on the actual values passed to the function;


and other properties are as above.
and other properties are as above.
For calls to host functions, the <tt>"where"</tt> and <tt>"environment"</tt> properties may be absent.


The argument list may be incomplete or inaccurate, for various reasons. If the program has assigned to its formal parameters, the original values passed may have been lost, and compiler optimizations may drop some argument values.
The argument list may be incomplete or inaccurate, for various reasons. If the program has assigned to its formal parameters, the original values passed may have been lost, and compiler optimizations may drop some argument values.
=== Host Function Call Frames ===
A frame for a call to a host function (a function provided by the JavaScript implementation, usually written in the same language as the implementation itself) has the form:
  { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
    "type":"host-call",
    "callee":<i>callee</i>, "callee-name":<i>callee-name</i>, "this":<i>this</i>, "arguments":<i>arguments</i> }
where the properties are as defined above. (Compared to an ordinary call, the <tt>where</tt> and <tt>environment</tt> properties are missing.)


=== Eval Frames ===
=== Eval Frames ===
Line 681: Line 674:


   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
     "type":"eval", "where":<i>location</i>, "environment",<i>environment</i> }
     "type":"eval", "this":<i>this</i>,
    "where":<i>location</i>, "environment",<i>environment</i> }


where the properties are as defined above.
where the properties are as defined above.
Line 690: Line 684:


   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
   { "actor":<i>actor</i>, "depth":<i>depth</i>, "id":<i>id</i>,
     "type":"client-evaluate", "where":<i>location</i>, "environment",<i>environment</i> }
     "type":"client-evaluate", "this":<i>this</i>,
    "where":<i>location</i>, "environment",<i>environment</i> }


where the properties are as defined above. In this case, <i>where</i> will be a location inside the expression provided by the debugger.
where the properties are as defined above. In this case, <i>where</i> will be a location inside the expression provided by the debugger.
Confirmed users
496

edits

Navigation menu