Remote Debugging Protocol: Difference between revisions

[master 821a90d] Tweak description of 'sources' request and source actors.
([master e56f75e] Fix typo in safeGetterValues example.)
([master 821a90d] Tweak description of 'sources' request and source actors.)
Line 825: Line 825:
To get a snapshot of all sources currently loaded by the thread actor, the client can send the following packet:
To get a snapshot of all sources currently loaded by the thread actor, the client can send the following packet:


   { to: <i>threadActorID</i>,
   { to: <i>threadActorID</i>, type: "sources" }
    type: "sources" }


The response packet has the following form:
The response packet has the form:


   { from: <i>threadActorID</i>,
   { from: <i>threadActorID</i>, sources: [<i>sourceForm1</i>, <i>sourceForm2</i>, ..., <i>sourceFormN</i>] }
    sources: [<i>sourceForm1</i>, <i>sourceForm2</i>, ..., <i>sourceFormN</i>] }


Where each <i>sourceForm</i> has the following form:
Where each <i>sourceForm</i> has the following form:


   { actor: <i>sourceActorID</i>,
   { actor: <i>sourceActorID</i>, url: <i>sourceURL</i> }
    url: <i>sourceURL</i> }


Each source actor exists throughout the thread's whole lifetime.
Each source actor exists throughout the thread's whole lifetime.
Line 842: Line 839:
To get the contents of a source, send the corresponding source actor the following packet:
To get the contents of a source, send the corresponding source actor the following packet:


   { to: <i>sourceActorID</i>,
   { to: <i>sourceActorID</i>, type: "source" }
    type: "source" }


And the source actor replies with a packet of the following form:
And the source actor replies with a packet of the following form:


   { from: <i>sourceActorID</i>,
   { from: <i>sourceActorID</i>, source: <i>contentsOfSource</i> }
    source: <i>contentsOfSource</i> }
 
where <i>contentsOfSource</i> is a grip representing the string of source code: either a JSON string, or a long string grip. (See [[#Grips|Grips]] for a description of long string grips.)


== Listing Stack Frames ==
== Listing Stack Frames ==
Confirmed users
496

edits