| OLD | NEW |
| 1 # Dart VM Service Protocol 3.5 | 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.5_ 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, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 134 of [Response](#response) and provides a _type_ paramters which can be used | 134 of [Response](#response) and provides a _type_ parameter which can be used |
| 135 to distinguish the exact return type. In the example above, the | 135 to distinguish the exact return type. In the example above, the |
| 136 [Version](#version) type is returned. | 136 [Version](#version) type is returned. |
| 137 | 137 |
| 138 Here is an example [streamListen](#streamlisten) request which provides | 138 Here is an example [streamListen](#streamlisten) request which provides |
| 139 a parameter: | 139 a parameter: |
| 140 | 140 |
| 141 ``` | 141 ``` |
| 142 { | 142 { |
| 143 "jsonrpc": "2.0", | 143 "jsonrpc": "2.0", |
| 144 "method": "streamListen", | 144 "method": "streamListen", |
| (...skipping 20 matching lines...) Expand all Loading... |
| 165 "code": 103, | 165 "code": 103, |
| 166 "message": "Stream already subscribed", | 166 "message": "Stream already subscribed", |
| 167 "data": { | 167 "data": { |
| 168 "details": "The stream 'GC' is already subscribed" | 168 "details": "The stream 'GC' is already subscribed" |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 "id": "2" | 171 "id": "2" |
| 172 } | 172 } |
| 173 ``` | 173 ``` |
| 174 | 174 |
| 175 In addition the [error codes](http://www.jsonrpc.org/specification#error_object) | 175 In addition to the [error codes](http://www.jsonrpc.org/specification#error_obje
ct) specified in the JSON-RPC spec, we use the following application specific er
ror codes: |
| 176 specified in the JSON-RPC spec, we use the following application specific error
codes: | |
| 177 | 176 |
| 178 code | message | meaning | 177 code | message | meaning |
| 179 ---- | ------- | ------- | 178 ---- | ------- | ------- |
| 180 100 | Feature is disabled | The operation is unable to complete because a featur
e is disabled | 179 100 | Feature is disabled | The operation is unable to complete because a featur
e is disabled |
| 181 101 | VM must be paused | This operation is only valid when the VM is paused | 180 101 | VM must be paused | This operation is only valid when the VM is paused |
| 182 102 | Cannot add breakpoint | The VM is unable to add a breakpoint at the specif
ied line or function | 181 102 | Cannot add breakpoint | The VM is unable to add a breakpoint at the specif
ied line or function |
| 183 103 | Stream already subscribed | The client is already subscribed to the specif
ied _streamId_ | 182 103 | Stream already subscribed | The client is already subscribed to the specif
ied _streamId_ |
| 184 104 | Stream not subscribed | The client is not subscribed to the specified _str
eamId_ | 183 104 | Stream not subscribed | The client is not subscribed to the specified _str
eamId_ |
| 185 105 | Isolate must be runnable | This operation cannot happen until the isolate
is runnable | 184 105 | Isolate must be runnable | This operation cannot happen until the isolate
is runnable |
| 185 106 | Isolate must be paused | This operation is only valid when the isolate is
paused |
| 186 | 186 |
| 187 | 187 |
| 188 | 188 |
| 189 | 189 |
| 190 ## Events | 190 ## Events |
| 191 | 191 |
| 192 By using the [streamListen](#streamlisten) and [streamCancel](#streamcancel) RPC
s, a client may | 192 By using the [streamListen](#streamlisten) and [streamCancel](#streamcancel) RPC
s, a client may |
| 193 request to be notified when an _event_ is posted to a specific | 193 request to be notified when an _event_ is posted to a specific |
| 194 _stream_ in the VM. Every stream has an associated _stream id_ which | 194 _stream_ in the VM. Every stream has an associated _stream id_ which |
| 195 is used to name that stream. | 195 is used to name that stream. |
| (...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 | 2520 |
| 2521 version | comments | 2521 version | comments |
| 2522 ------- | -------- | 2522 ------- | -------- |
| 2523 1.0 | initial revision | 2523 1.0 | initial revision |
| 2524 2.0 | Describe protocol version 2.0. | 2524 2.0 | Describe protocol version 2.0. |
| 2525 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. | 2525 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. |
| 2526 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. | 2526 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. |
| 2527 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. | 2527 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. |
| 2528 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. | 2528 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. |
| 2529 3.4 | Add the superType and mixin fields to Class. Added new pause event 'None'. | 2529 3.4 | Add the superType and mixin fields to Class. Added new pause event 'None'. |
| 2530 3.5 | Add the error field to SourceReportRange. Clarify definition of token pos
ition. | 2530 3.5 | Add the error field to SourceReportRange. Clarify definition of token pos
ition. Add "Isolate must be paused" error code. |
| 2531 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss | 2531 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss |
| OLD | NEW |