Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Dart VM Service Protocol | 1 # Dart VM Service Protocol |
| 2 | 2 |
| 3 Description | 3 Description |
| 4 How to start | 4 How to start |
| 5 JSON | 5 JSON |
| 6 Websocket | 6 Websocket |
| 7 | 7 |
| 8 ## Types | 8 ## Types |
| 9 | 9 |
| 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). | 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). |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 { | 24 { |
| 25 type: "@Isolate", | 25 type: "@Isolate", |
| 26 id: "isolates/123", | 26 id: "isolates/123", |
| 27 name: "worker" | 27 name: "worker" |
| 28 entry: ... | 28 entry: ... |
| 29 heaps: ... | 29 heaps: ... |
| 30 topFrame: ... | 30 topFrame: ... |
| 31 ... | 31 ... |
| 32 } | 32 } |
| 33 | 33 |
| 34 ## IDs | 34 ## IDs |
| 35 | 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. | 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 | 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>. | 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 | 39 |
| 40 The following is a list of known, fixed global ids: | 40 The following is a list of known, fixed global ids: |
| 41 | 41 |
| 42 | id | uri | type | 42 | id | uri | type |
| 43 | --- | --- | --- | 43 | --- | --- | --- |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 | pauseOnExit | bool | | 97 | pauseOnExit | bool | |
| 98 | pauseEvent? | [DebuggerEvent](#DebuggerEvent) | | 98 | pauseEvent? | [DebuggerEvent](#DebuggerEvent) | |
| 99 | rootLib | [@Library](#atLibrary) | | 99 | rootLib | [@Library](#atLibrary) | |
| 100 | timers | ??? | | 100 | timers | ??? | |
| 101 | tagCounters | ??? | | 101 | tagCounters | ??? | |
| 102 | error? | [Error](#Error) | | 102 | error? | [Error](#Error) | |
| 103 | canonicalTypeArguments | | kill? | | 103 | canonicalTypeArguments | | kill? | |
| 104 | libs | List of [@Library](#atLibrary) | | 104 | libs | List of [@Library](#atLibrary) | |
| 105 | features | List of String | | 105 | features | List of String | |
| 106 | 106 |
| 107 | |
| 108 ### <a name="atLibrary"></a>@Library | 107 ### <a name="atLibrary"></a>@Library |
| 109 | 108 |
| 110 | keys | values | comments | 109 | keys | values | comments |
| 111 | --- | --- | --- | 110 | --- | --- | --- |
| 112 | type | "@Library" | | 111 | type | "@Library" | |
| 113 | id | String | | 112 | id | String | |
| 114 | user_name | String | | 113 | user_name | String | |
| 115 | name | String | 114 | name | String |
| 116 | url | String | 115 | url | String |
| 117 | 116 |
| 118 ### <a name="Library"></a>Library | 117 ### <a name="Library"></a>Library |
| 119 | 118 |
| 120 | keys | values | comments | 119 | keys | values | comments |
| 121 | --- | --- | --- | 120 | --- | --- | --- |
| 122 | type | "Library" | | 121 | type | "Library" | |
| 123 | id | String | | 122 | id | String | |
| 124 | user_name | String | | 123 | user_name | String | |
| 125 | name | String | 124 | name | String |
| 126 | classes | List of [@Class](#atClass) | | 125 | classes | List of [@Class](#atClass) | |
| 127 | imports | List of [@Library](#atLibrary) | | 126 | imports | List of [@Library](#atLibrary) | |
| 128 | variables | List of ... | | 127 | variables | List of ... | |
| 129 | functions | List of [@Function](#atFunction) | | 128 | functions | List of [@Function](#atFunction) | |
| 130 | scripts | List of [@Script](#atScript) | | 129 | scripts | List of [@Script](#atScript) | |
| 131 | 130 |
| 131 ### <a name="atClass"></a>@Class | |
| 132 | keys | values | comments | |
| 133 | --- | --- | --- | |
| 134 | type | "@Class" | | |
| 135 | id | String | | |
| 136 | user_name | String | | |
| 137 | name | String | | |
| 138 | |
| 139 ### <a name="Class"></a>Class | |
| 140 | keys | values | comments | |
| 141 | --- | --- | --- | |
| 142 | type | "@Class" | | |
| 143 | id | String | | |
| 144 | user_name | String | | |
| 145 | name | String | | |
| 146 | error | [Error](#Error) | (optional) Error encountered during class finalizati on | |
|
turnidge
2014/08/21 00:33:01
I have been using ? for optional properties. What
Cutch
2014/08/26 20:29:28
Done.
| |
| 147 | implemented | bool | | |
| 148 | abstract | bool | | |
| 149 | patch | bool | | |
| 150 | finalized | bool | | |
| 151 | const | bool | | |
| 152 | super | [@Class](#atClass) | (optional) Super class | |
| 153 | library | [@Library](#atLibrary) | Owning library | |
| 154 | script | [@Script](#atScript) | (optional) Script containing class source | |
| 155 | tokenPos | int | starting token position of class source in script | |
| 156 | endTokenPos | int | end token position of class source in script | |
| 157 | interfaces | List of [@Class](#atClass) | interfaces this class has implemente d | |
| 158 | fields | List of [@Field](#atField) | | |
| 159 | functions | List of [@Function](#atFunction) | | |
| 160 | subclasses | List of [@Class](#atClass) | classes which extend this class. | |
| 161 | canonicalTypes | [@TypeList] | kill? | |
| 162 | allocationStats | ClassHeapStats | | |
| 163 | |
| 164 ### <a name="atFunction"></a>@Function | |
| 165 | keys | values | comments | |
| 166 | --- | --- | --- | |
| 167 | type | "@Function" | | |
| 168 | id | String | | |
| 169 | user_name | String | | |
| 170 | name | String | | |
| 171 | owningLibrary | [@Library](#atLibrary) | Set for non-top level functions | |
|
turnidge
2014/08/21 00:33:01
optional.
Cutch
2014/08/26 20:29:28
Done.
| |
| 172 | owningClass | [@Class](#atClass) | Set for non-top level functions | |
|
turnidge
2014/08/21 00:33:01
optional.
Cutch
2014/08/26 20:29:28
Done.
| |
| 173 | parent | [@Function](#atFunction) | (optional) Parent function | |
| 174 | kind | String | | |
| 175 | |
| 176 ### <a name="Function"></a>Function | |
| 177 | keys | values | comments | |
| 178 | --- | --- | --- | |
| 179 | type | "@Function" | | |
| 180 | id | String | | |
| 181 | user_name | String | | |
| 182 | name | String | | |
| 183 | owningLibrary | [@Library](#atLibrary) | Set for non-top level functions | |
| 184 | owningClass | [@Class](#atClass) | Set for non-top level functions | |
|
turnidge
2014/08/21 00:33:01
ditto these two.
Cutch
2014/08/26 20:29:28
Done.
| |
| 185 | parent | [@Function](#atFunction) | (optional) Parent function | |
| 186 | kind | String | | |
| 187 | is_static | bool | | |
| 188 | is_const | bool | | |
| 189 | is_optimizable | bool | | |
| 190 | is_inlinable | bool | | |
| 191 | usage_counter | int | | |
| 192 | optimized_call_site_count | int | | |
| 193 | deoptimizations | int | | |
| 194 | script | [@Script](#atScript) | (optional) Script containing function source | |
| 195 | tokenPos | int | starting token position of function source in script | |
| 196 | endTokenPos | int | end token position of function source in script | |
| 197 | unoptimized_code | [@Code](#atCode) | | |
| 198 | code | [@Code](#atCode) | Current code | |
| 199 | |
| 200 ### <a name="atField"></a>@Field | |
| 201 | keys | values | comments | |
| 202 | --- | --- | --- | |
| 203 | type | "@Field" | | |
| 204 | id | String | | |
| 205 | user_name | String | | |
| 206 | name | String | | |
| 207 | value | Instance | (optional) value associated with static field <-- do we wan t to include this in a field reference? | |
|
turnidge
2014/08/21 00:33:01
Good catch, probably not.
Cutch
2014/08/26 20:29:28
Acknowledged.
| |
| 208 | owner | [@Library](#atLibrary) | Owning library <-- handling of owner is incon sistent with Function | |
| 209 | owner | [@Class](#atClass) | Owning class <-- handling of owner is inconsisten t with Function | |
|
turnidge
2014/08/21 00:33:01
I have been thinking of using a comma when multipl
Cutch
2014/08/26 20:29:28
Done.
| |
| 210 | declared_type | [@AbstractType](#atAbstractType) | | |
| 211 | static | bool | | |
| 212 | final | bool | | |
| 213 | const | bool | | |
| 214 | |
| 215 ### <a name="Field"></a>Field | |
| 216 | keys | values | comments | |
| 217 | --- | --- | --- | |
| 218 | type | "Field" | | |
| 219 | id | String | | |
| 220 | user_name | String | | |
| 221 | name | String | | |
| 222 | value | Instance | (optional) value associated with static field <-- do we wan t to include this in a field reference? | |
| 223 | owner | [@Library](#atLibrary) | Owning library <-- handling of owner is incon sistent with Function | |
| 224 | owner | [@Class](#atClass) | Owning class <-- handling of owner is inconsisten t with Function | |
| 225 | declared_type | [@AbstractType](#atAbstractType) | | |
| 226 | static | bool | | |
| 227 | final | bool | | |
| 228 | const | bool | | |
| 229 | guard_nullable | bool | can this field hold a null? | |
| 230 | guard_class | String OR [@Class](#atClass) | "unknown", "dynamic", or a class | |
| 231 | guard_length | String OR int | "unknown", "variable", or length of array | |
| 232 | script | [@Script](#atScript) | (optional) Script containing field source | |
| 233 | tokenPos | int | starting token position of field source in script | |
| 234 | |
| 235 ### <a name="atCode"></a>@Code | |
| 236 | keys | values | comments | |
| 237 | --- | --- | --- | |
| 238 | type | "@Code" | | |
| 239 | id | String | | |
| 240 | user_name | String | | |
| 241 | name | String | | |
| 242 | start | String | starting address of code | |
| 243 | end | String | ending address of code | |
| 244 | isOptimized | bool | | |
| 245 | isAlive | bool | | |
| 246 | kind | String | |
| 247 | function | [@Function](#atFunction) | | |
| 248 | |
| 249 ### <a name="Code"></a>Code | |
| 250 | keys | values | comments | |
| 251 | --- | --- | --- | |
| 252 | type | "@Code" | | |
| 253 | id | String | | |
| 254 | user_name | String | | |
| 255 | name | String | | |
| 256 | start | String | starting address of code | |
| 257 | end | String | ending address of code | |
| 258 | isOptimized | bool | | |
| 259 | isAlive | bool | | |
| 260 | kind | String | |
| 261 | function | [@Function](#atFunction) | | |
| 262 | object_pool | List of [@Object](Object) | | |
| 263 | disassembly | List of String | See note below on disassembly list format | |
| 264 | |
| 265 *Disassembly list format* | |
| 266 | index | value | description | |
| 267 | --- | --- | --- | | |
| 268 | 0 | String | Address of instruction | |
| 269 | 1 | String | Hex encoding of instruction | |
| 270 | 2 | String | Human encoding of instruction | |
| 271 | 0 + (3 * K) | String | Address of Kth instruction | |
| 272 | 1 + (3 * K) | String | Hex encoding of instruction of Kth instruction | |
| 273 | 2 + (3 * K) | String | Human encoding of instruction of Kth instruction | |
| 274 | |
| 275 ### <a name="Error"></a>Error | |
| 276 | keys | values | comments | |
| 277 | --- | --- | --- | |
| 278 | type | "Error" | | |
| 279 | id | String | always empty | |
| 280 | kind | String | | |
| 281 | message | String | | |
| 282 | |
| 283 ### <a name="ClassHeapStats"></a>ClassHeapStats | |
| 284 | keys | values | comments | |
| 285 | --- | --- | --- | |
| 286 | type | "ClassHeapStats" | | |
| 287 | id | String | | |
| 288 | class | [@Class](#atClass) | | |
| 289 | new | List of int | Allocation statistics for new space. See note below on all ocation statistics list format. | |
| 290 | old | List of int | Allocation statistics for old space. See note below on all ocation statistics list format. | |
| 291 | promotedInstances | int | number of instances promoted at last new-space GC. | |
| 292 | promotedBytes | int | number of bytes promoted at last new-space GC. | |
| 293 | |
| 294 *Allocation statistics list format* | |
| 295 | index | value | description | |
| 296 | --- | --- | --- | | |
| 297 | 0 | int | Instances allocated before last GC | | |
| 298 | 1 | int | Bytes allocated before last GC | | |
| 299 | 2 | int | Instances alive after last GC | | |
| 300 | 3 | int | Bytes alive after last GC | | |
| 301 | 4 | int | Instances allocated since last GC | | |
| 302 | 5 | int | Bytes allocated since last GC | | |
| 303 | 6 | int | Instances allocated since last accumulator reset | | |
| 304 | 7 | int | Bytes allocated since last accumulator reset | | |
|
turnidge
2014/08/21 00:33:01
You should do the same thing with TokenLine down b
Cutch
2014/08/26 20:29:28
Done.
| |
| 305 | |
| 306 ### <a name="atAbstractType"></a>@AbstractType | |
| 307 | |
| 308 ### <a name="AbstractType"></a>AbstractType | |
| 309 | |
| 310 ### <a name="PcDescriptor"></a>PcDescriptor | |
| 311 | |
| 312 | |
| 132 ### <a name="atScript"></a>@Script | 313 ### <a name="atScript"></a>@Script |
| 133 | keys | values | comments | example | | 314 | keys | values | comments | example | |
| 134 | --- | --- | --- | 315 | --- | --- | --- |
| 135 | type | "@Script" | | 316 | type | "@Script" | |
| 136 | id | String | 317 | id | String |
| 137 | user_name | String | 318 | user_name | String |
| 138 | name | String | 319 | name | String |
| 139 | kind | String | 320 | kind | String |
| 140 | 321 |
| 141 ### <a name="Script"></a>Script | 322 ### <a name="Script"></a>Script |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 152 | 333 |
| 153 ### <a name="TokenLine"></a>TokenLine | 334 ### <a name="TokenLine"></a>TokenLine |
| 154 | index | value | comments | 335 | index | value | comments |
| 155 | --- | --- | --- | 336 | --- | --- | --- |
| 156 | 0 | integer | line number | 337 | 0 | integer | line number |
| 157 | 1 | integer | first token position | 338 | 1 | integer | first token position |
| 158 | 2 | integer | first column number | 339 | 2 | integer | first column number |
| 159 | ... | ... | ... | 340 | ... | ... | ... |
| 160 | 1 + (2 * k) | integer | kth token position | 341 | 1 + (2 * k) | integer | kth token position |
| 161 | 2 + (2 * k) | integer | kth column number | 342 | 2 + (2 * k) | integer | kth column number |
| OLD | NEW |