| OLD | NEW |
| 1 # Dart VM Service Protocol | 1 # Dart VM Service Protocol |
| 2 | 2 |
| 3 Description | 3 Description |
| 4 How to start |
| 5 JSON |
| 6 Websocket |
| 4 | 7 |
| 5 ## Response Format | 8 ## Types |
| 6 | 9 |
| 7 ### VM | 10 Every response returned by the VM Service has the <code>type</code> property. T
his allows the client distinguish between different kinds of responses. For exa
mple, global information about the VM is encoded in an response of type [VM](#VM
) and information about an isolate is encoded in an response of type [Isolate](#
Isolate). |
| 11 |
| 12 If the type name of a response begins with an <code>@</code> character then that
response is a _reference_. If the type name of a response does not begin with
an <code>@</code> character then that response is an _object_ (or sometimes _ful
l object_). A reference is meant to be a subset of a full object with just enou
gh information for the client to generate a reasonable-looking link. |
| 13 |
| 14 For example, an isolate reference may look like this... |
| 15 |
| 16 { |
| 17 type: "@Isolate", |
| 18 id: "isolates/123", |
| 19 name: "worker" |
| 20 } |
| 21 |
| 22 ... and a full isolate object would have additional properties: |
| 23 |
| 24 { |
| 25 type: "@Isolate", |
| 26 id: "isolates/123", |
| 27 name: "worker" |
| 28 entry: ... |
| 29 heaps: ... |
| 30 topFrame: ... |
| 31 ... |
| 32 } |
| 33 |
| 34 ## IDs |
| 35 |
| 36 Most responses returned by the VM Service have an <code>id</code> property. An
id is used to request an object from the VM. |
| 37 |
| 38 An id is either _global_ or _relative_. Global ids can be requested from the VM
directly by requesting the uri <code>/{global id}</code>. |
| 39 |
| 40 The following is a list of known, fixed global ids: |
| 41 |
| 42 | id | uri | type |
| 43 | --- | --- | --- |
| 44 | vm | /vm | [VM](#VM) |
| 45 | flags | /flags | [FlagList](#FlagList) |
| 46 |
| 47 In addition, all isolates have global ids, but these ids are dynamically generat
ed. An isolate with an id like <code>isolates/123</code> would be available at
the uri <code>/isolates/123</code>. |
| 48 |
| 49 Relative ids are used to refer to objects that are owned by an isolate. Relativ
e ids can be requested from the VM directly by requesting the uri <code>/{isolat
e id}/{relative id}</code>. |
| 50 |
| 51 For example, we can get information about a class with id <code>classes/Foo</cod
e> from isolate <code>isolates/123</code> by requesting the uri <code>/isolates/
123/classes/Foo</code> from the VM. |
| 52 |
| 53 The client must not parse ids -- they must be treated as opaque strings. We res
erve the right to change the ids of objects. |
| 54 |
| 55 ## Events |
| 56 |
| 57 TODO |
| 58 |
| 59 ## Catalog of Types |
| 60 ### <a name="VM"></a>VM |
| 8 | 61 |
| 9 | keys | values | comments | 62 | keys | values | comments |
| 10 | --- | --- | --- | 63 | --- | --- | --- |
| 11 | type | "VM" | | 64 | type | "VM" | |
| 12 | id | String | | 65 | id | String | |
| 13 | targetCPU | String | | 66 | targetCPU | String | |
| 14 | hostCPU | String | | 67 | hostCPU | String | |
| 15 | date | String | kill? | | 68 | date | String | kill? | |
| 16 | version | String | | 69 | version | String | |
| 17 | pid | int | | 70 | pid | int | |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 ### Isolate | 85 ### Isolate |
| 33 | 86 |
| 34 | keys | values | comments | 87 | keys | values | comments |
| 35 | --- | --- | --- | 88 | --- | --- | --- |
| 36 | type | "Isolate" | | 89 | type | "Isolate" | |
| 37 | id | String | | 90 | id | String | |
| 38 | mainPort | String | kill? | | 91 | mainPort | String | kill? | |
| 39 | name | String | | 92 | name | String | |
| 40 | entry? | [@Function](#atFunction) | | 93 | entry? | [@Function](#atFunction) | |
| 41 | heaps | ??? | | 94 | heaps | ??? | |
| 42 | topFrame? | [@Frame](#atFrame) | | 95 | topFrame? | [Frame](#Frame) | |
| 43 | livePorts | int | | 96 | livePorts | int | |
| 44 | pauseOnExit | bool | | 97 | pauseOnExit | bool | |
| 45 | pauseEvent? | [DebuggerEvent](#DebuggerEvent) | | 98 | pauseEvent? | [DebuggerEvent](#DebuggerEvent) | |
| 46 | rootLib | [@Library](#atLibrary) | | 99 | rootLib | [@Library](#atLibrary) | |
| 47 | timers | ??? | | 100 | timers | ??? | |
| 48 | tagCounters | ??? | | 101 | tagCounters | ??? | |
| 49 | error? | [Error](#Error) | | 102 | error? | [Error](#Error) | |
| 50 | canonicalTypeArguments | | kill? | | 103 | canonicalTypeArguments | | kill? | |
| 51 | libs | List of [@Library](#atLibrary) | | 104 | libs | List of [@Library](#atLibrary) | |
| 52 | features | List of String | | 105 | features | List of String | |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 152 |
| 100 ### <a name="TokenLine"></a>TokenLine | 153 ### <a name="TokenLine"></a>TokenLine |
| 101 | index | value | comments | 154 | index | value | comments |
| 102 | --- | --- | --- | 155 | --- | --- | --- |
| 103 | 0 | integer | line number | 156 | 0 | integer | line number |
| 104 | 1 | integer | first token position | 157 | 1 | integer | first token position |
| 105 | 2 | integer | first column number | 158 | 2 | integer | first column number |
| 106 | ... | ... | ... | 159 | ... | ... | ... |
| 107 | 1 + (2 * k) | integer | kth token position | 160 | 1 + (2 * k) | integer | kth token position |
| 108 | 2 + (2 * k) | integer | kth column number | 161 | 2 + (2 * k) | integer | kth column number |
| OLD | NEW |