| OLD | NEW |
| 1 # Dart VM Service Protocol 3.4 | 1 # Dart VM Service Protocol 3.5 |
| 2 | 2 |
| 3 > Please post feedback to the [observatory-discuss group][discuss-list] | 3 > Please post feedback to the [observatory-discuss group][discuss-list] |
| 4 | 4 |
| 5 This document describes of _version 3.4_ of the Dart VM Service Protocol. This | 5 This document describes of _version 3.5_ of the Dart VM Service Protocol. This |
| 6 protocol is used to communicate with a running Dart Virtual Machine. | 6 protocol is used to communicate with a running Dart Virtual Machine. |
| 7 | 7 |
| 8 To use the Service Protocol, start the VM with the *--observe* flag. | 8 To use the Service Protocol, start the VM with the *--observe* flag. |
| 9 The VM will start a webserver which services protocol requests via WebSocket. | 9 The VM will start a webserver which services protocol requests via WebSocket. |
| 10 It is possible to make HTTP (non-WebSocket) requests, | 10 It is possible to make HTTP (non-WebSocket) requests, |
| 11 but this does not allow access to VM _events_ and is not documented | 11 but this does not allow access to VM _events_ and is not documented |
| 12 here. | 12 here. |
| 13 | 13 |
| 14 The Service Protocol uses [JSON-RPC 2.0][]. | 14 The Service Protocol uses [JSON-RPC 2.0][]. |
| 15 | 15 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 was successful, the _result_ property provides the result. | 113 was successful, the _result_ property provides the result. |
| 114 | 114 |
| 115 Here is an example response for our [getVersion](#getversion) request above: | 115 Here is an example response for our [getVersion](#getversion) request above: |
| 116 | 116 |
| 117 ``` | 117 ``` |
| 118 { | 118 { |
| 119 "jsonrpc": "2.0", | 119 "jsonrpc": "2.0", |
| 120 "result": { | 120 "result": { |
| 121 "type": "Version", | 121 "type": "Version", |
| 122 "major": 3, | 122 "major": 3, |
| 123 "minor": 0 | 123 "minor": 5 |
| 124 } | 124 } |
| 125 "id": "1" | 125 "id": "1" |
| 126 } | 126 } |
| 127 ``` | 127 ``` |
| 128 | 128 |
| 129 Parameters for RPC requests are always provided as _named_ parameters. | 129 Parameters for RPC requests are always provided as _named_ parameters. |
| 130 The JSON-RPC spec provides for _positional_ parameters as well, but they | 130 The JSON-RPC spec provides for _positional_ parameters as well, but they |
| 131 are not supported by the Dart VM. | 131 are not supported by the Dart VM. |
| 132 | 132 |
| 133 By convention, every response returned by the Service Protocol is a subtype | 133 By convention, every response returned by the Service Protocol is a subtype |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 ## Versioning | 304 ## Versioning |
| 305 | 305 |
| 306 The [getVersion](#getversion) RPC can be used to find the version of the protoco
l | 306 The [getVersion](#getversion) RPC can be used to find the version of the protoco
l |
| 307 returned by a VM. The _Version_ response has a major and a minor | 307 returned by a VM. The _Version_ response has a major and a minor |
| 308 version number: | 308 version number: |
| 309 | 309 |
| 310 ``` | 310 ``` |
| 311 "result": { | 311 "result": { |
| 312 "type": "Version", | 312 "type": "Version", |
| 313 "major": 3, | 313 "major": 3, |
| 314 "minor": 0 | 314 "minor": 5 |
| 315 } | 315 } |
| 316 ``` | 316 ``` |
| 317 | 317 |
| 318 The major version number is incremented when the protocol is changed | 318 The major version number is incremented when the protocol is changed |
| 319 in a potentially _incompatible_ way. An example of an incompatible | 319 in a potentially _incompatible_ way. An example of an incompatible |
| 320 change is removing a non-optional property from a result. | 320 change is removing a non-optional property from a result. |
| 321 | 321 |
| 322 The minor version number is incremented when the protocol is changed | 322 The minor version number is incremented when the protocol is changed |
| 323 in a _backwards compatible_ way. An example of a backwards compatible | 323 in a _backwards compatible_ way. An example of a backwards compatible |
| 324 change is adding a property to a result. | 324 change is adding a property to a result. |
| (...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 | 2310 |
| 2311 // The token position at which this range begins. | 2311 // The token position at which this range begins. |
| 2312 int startPos; | 2312 int startPos; |
| 2313 | 2313 |
| 2314 // The token position at which this range ends. Inclusive. | 2314 // The token position at which this range ends. Inclusive. |
| 2315 int endPos; | 2315 int endPos; |
| 2316 | 2316 |
| 2317 // Has this range been compiled by the Dart VM? | 2317 // Has this range been compiled by the Dart VM? |
| 2318 bool compiled; | 2318 bool compiled; |
| 2319 | 2319 |
| 2320 // The error while attempting to compile this range, if this |
| 2321 // report was generated with forceCompile=true. |
| 2322 @Error error [optional]; |
| 2323 |
| 2320 // Code coverage information for this range. Provided only when the | 2324 // Code coverage information for this range. Provided only when the |
| 2321 // Coverage report has been requested and the range has been | 2325 // Coverage report has been requested and the range has been |
| 2322 // compiled. | 2326 // compiled. |
| 2323 SourceReportCoverage coverage [optional]; | 2327 SourceReportCoverage coverage [optional]; |
| 2324 | 2328 |
| 2325 // Possible breakpoint information for this range, represented as a | 2329 // Possible breakpoint information for this range, represented as a |
| 2326 // sorted list of token positions. Provided only when the when the | 2330 // sorted list of token positions. Provided only when the when the |
| 2327 // PossibleBreakpoint report has been requested and the range has been | 2331 // PossibleBreakpoint report has been requested and the range has been |
| 2328 // compiled. | 2332 // compiled. |
| 2329 int[] possibleBreakpoints [optional]; | 2333 int[] possibleBreakpoints [optional]; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 | 2516 |
| 2513 version | comments | 2517 version | comments |
| 2514 ------- | -------- | 2518 ------- | -------- |
| 2515 1.0 | initial revision | 2519 1.0 | initial revision |
| 2516 2.0 | Describe protocol version 2.0. | 2520 2.0 | Describe protocol version 2.0. |
| 2517 3.0 | Describe protocol version 3.0. Added UnresolvedSourceLocation. Added Sen
tinel return to getIsolate. Add AddedBreakpointWithScriptUri. Removed Isolate.
entry. The type of VM.pid was changed from string to int. Added VMUpdate events
. Add offset and count parameters to getObject() and offset and count fields to
Instance. Added ServiceExtensionAdded event. | 2521 3.0 | Describe protocol version 3.0. Added UnresolvedSourceLocation. Added Sen
tinel return to getIsolate. Add AddedBreakpointWithScriptUri. Removed Isolate.
entry. The type of VM.pid was changed from string to int. Added VMUpdate events
. Add offset and count parameters to getObject() and offset and count fields to
Instance. Added ServiceExtensionAdded event. |
| 2518 3.1 | Add the getSourceReport RPC. The getObject RPC now accepts offset and cou
nt for string objects. String objects now contain length, offset, and count pro
perties. | 2522 3.1 | Add the getSourceReport RPC. The getObject RPC now accepts offset and cou
nt for string objects. String objects now contain length, offset, and count pro
perties. |
| 2519 3.2 | Isolate objects now include the runnable bit and many debugger related RPC
s will return an error if executed on an isolate before it is runnable. | 2523 3.2 | Isolate objects now include the runnable bit and many debugger related RPC
s will return an error if executed on an isolate before it is runnable. |
| 2520 3.3 | Pause event now indicates if the isolate is paused at an await, yield, or
yield* suspension point via the 'atAsyncSuspension' field. Resume command now su
pports the step parameter 'OverAsyncSuspension'. A Breakpoint added syntheticall
y by an 'OverAsyncSuspension' resume command identifies itself as such via the '
isSyntheticAsyncContinuation' field. | 2524 3.3 | Pause event now indicates if the isolate is paused at an await, yield, or
yield* suspension point via the 'atAsyncSuspension' field. Resume command now su
pports the step parameter 'OverAsyncSuspension'. A Breakpoint added syntheticall
y by an 'OverAsyncSuspension' resume command identifies itself as such via the '
isSyntheticAsyncContinuation' field. |
| 2521 3.4 | Add the superType and mixin fields to Class. Added new pause event 'None'. | 2525 3.4 | Add the superType and mixin fields to Class. Added new pause event 'None'. |
| 2526 3.5 | Add the error field to SourceReportRange. |
| 2522 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss | 2527 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss |
| OLD | NEW |