| OLD | NEW |
| 1 # Dart VM Service Protocol 1.0 (Draft 1) | 1 # Dart VM Service Protocol 1.0 (Draft 1) |
| 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 _draft 1_ of _version 1.0_ of the Dart VM | 5 This document describes _draft 1_ of _version 1.0_ of the Dart VM |
| 6 Service Protocol. This protocol is used to communicate with a running | 6 Service Protocol. This protocol is used to communicate with a running |
| 7 Dart Virtual Machine. | 7 Dart Virtual Machine. |
| 8 | 8 |
| 9 To use the Service Protocol, start the VM with the *--observe* flag. | 9 To use the Service Protocol, start the VM with the *--observe* flag. |
| 10 The VM will start a webserver which services protocol requests via WebSocket. | 10 The VM will start a webserver which services protocol requests via WebSocket. |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 string name; | 831 string name; |
| 832 | 832 |
| 833 // What kind of code object is this? | 833 // What kind of code object is this? |
| 834 CodeKind kind; | 834 CodeKind kind; |
| 835 } | 835 } |
| 836 ``` | 836 ``` |
| 837 | 837 |
| 838 _@Code_ is a reference to a _Code_ object. | 838 _@Code_ is a reference to a _Code_ object. |
| 839 | 839 |
| 840 ``` | 840 ``` |
| 841 class @Code extends @Object { | 841 class Code extends @Object { |
| 842 // A name for this code object. | 842 // A name for this code object. |
| 843 string name; | 843 string name; |
| 844 | 844 |
| 845 // What kind of code object is this? | 845 // What kind of code object is this? |
| 846 CodeKind kind; | 846 CodeKind kind; |
| 847 } | 847 } |
| 848 ``` | 848 ``` |
| 849 | 849 |
| 850 A _Code_ object represents compiled code in the Dart VM. | 850 A _Code_ object represents compiled code in the Dart VM. |
| 851 | 851 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 } | 1137 } |
| 1138 ``` | 1138 ``` |
| 1139 | 1139 |
| 1140 A _Flag_ represents a single VM command line flag. | 1140 A _Flag_ represents a single VM command line flag. |
| 1141 | 1141 |
| 1142 ### FlagList | 1142 ### FlagList |
| 1143 | 1143 |
| 1144 ``` | 1144 ``` |
| 1145 class FlagList extends Response { | 1145 class FlagList extends Response { |
| 1146 // A list of all flags which are set to default values. | 1146 // A list of all flags which are set to default values. |
| 1147 unmodifiedFlags []Flag | 1147 Flag[] unmodifiedFlags; |
| 1148 | 1148 |
| 1149 // A list of all flags which have been modified by the user. | 1149 // A list of all flags which have been modified by the user. |
| 1150 modifiedFlags []Flag | 1150 Flag[] modifiedFlags; |
| 1151 } | 1151 } |
| 1152 ``` | 1152 ``` |
| 1153 | 1153 |
| 1154 A _FlagList_ represents the complete set of VM command line flags. | 1154 A _FlagList_ represents the complete set of VM command line flags. |
| 1155 | 1155 |
| 1156 ### Frame | 1156 ### Frame |
| 1157 | 1157 |
| 1158 ``` | 1158 ``` |
| 1159 class Frame extends Response { | 1159 class Frame extends Response { |
| 1160 int index; | 1160 int index; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1171 ``` | 1171 ``` |
| 1172 class @Function extends @Object { | 1172 class @Function extends @Object { |
| 1173 // The name of this function. | 1173 // The name of this function. |
| 1174 string name; | 1174 string name; |
| 1175 | 1175 |
| 1176 // The owner of this field, which can be a Library, Class, or a | 1176 // The owner of this field, which can be a Library, Class, or a |
| 1177 // Function. | 1177 // Function. |
| 1178 @Library|@Class|@Function owner; | 1178 @Library|@Class|@Function owner; |
| 1179 | 1179 |
| 1180 // Is this function static? | 1180 // Is this function static? |
| 1181 bool static | 1181 bool static; |
| 1182 | 1182 |
| 1183 // Is this function const? | 1183 // Is this function const? |
| 1184 bool const; | 1184 bool const; |
| 1185 | |
| 1186 } | 1185 } |
| 1187 ``` | 1186 ``` |
| 1188 | 1187 |
| 1189 An _@Function_ is a reference to a _Function_. | 1188 An _@Function_ is a reference to a _Function_. |
| 1190 | 1189 |
| 1191 | 1190 |
| 1192 ``` | 1191 ``` |
| 1193 // A Dart language function. | |
| 1194 class Function extends Object { | 1192 class Function extends Object { |
| 1195 // The name of this function. | 1193 // The name of this function. |
| 1196 string name; | 1194 string name; |
| 1197 | 1195 |
| 1198 // The owner of this field, which can be a Library, Class, or a | 1196 // The owner of this field, which can be a Library, Class, or a |
| 1199 // Function. | 1197 // Function. |
| 1200 @Library|@Class|@Function owner; | 1198 @Library|@Class|@Function owner; |
| 1201 | 1199 |
| 1202 // The location of this function in the source code. | 1200 // The location of this function in the source code. |
| 1203 SourceLocation location [optional]; | 1201 SourceLocation location [optional]; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 // | 1268 // |
| 1271 // Provided for instance kinds: | 1269 // Provided for instance kinds: |
| 1272 // TypeParameter | 1270 // TypeParameter |
| 1273 @Class parameterizedClass [optional]; | 1271 @Class parameterizedClass [optional]; |
| 1274 | 1272 |
| 1275 | 1273 |
| 1276 // The pattern of a RegExp instance. | 1274 // The pattern of a RegExp instance. |
| 1277 // | 1275 // |
| 1278 // Provided for instance kinds: | 1276 // Provided for instance kinds: |
| 1279 // RegExp | 1277 // RegExp |
| 1280 @String pattern [optional]; | 1278 String pattern [optional]; |
| 1281 } | 1279 } |
| 1282 ``` | 1280 ``` |
| 1283 | 1281 |
| 1284 _@Instance_ is a reference to an _Instance_. | 1282 _@Instance_ is a reference to an _Instance_. |
| 1285 | 1283 |
| 1286 ``` | 1284 ``` |
| 1287 class Instance extends Object { | 1285 class Instance extends Object { |
| 1288 // What kind of instance is this? | 1286 // What kind of instance is this? |
| 1289 InstanceKind kind; | 1287 InstanceKind kind; |
| 1290 | 1288 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 // The referent of a MirrorReference instance. | 1390 // The referent of a MirrorReference instance. |
| 1393 // | 1391 // |
| 1394 // Provided for instance kinds: | 1392 // Provided for instance kinds: |
| 1395 // MirrorReference | 1393 // MirrorReference |
| 1396 @Instance mirrorReferent [optional]; | 1394 @Instance mirrorReferent [optional]; |
| 1397 | 1395 |
| 1398 // The pattern of a RegExp instance. | 1396 // The pattern of a RegExp instance. |
| 1399 // | 1397 // |
| 1400 // Provided for instance kinds: | 1398 // Provided for instance kinds: |
| 1401 // RegExp | 1399 // RegExp |
| 1402 @String pattern [optional]; | 1400 String pattern [optional]; |
| 1403 | 1401 |
| 1404 // The key for a WeakProperty instance. | 1402 // The key for a WeakProperty instance. |
| 1405 // | 1403 // |
| 1406 // Provided for instance kinds: | 1404 // Provided for instance kinds: |
| 1407 // WeakProperty | 1405 // WeakProperty |
| 1408 @Instance propertyKey [optional]; | 1406 @Instance propertyKey [optional]; |
| 1409 | 1407 |
| 1410 // The key for a WeakProperty instance. | 1408 // The key for a WeakProperty instance. |
| 1411 // | 1409 // |
| 1412 // Provided for instance kinds: | 1410 // Provided for instance kinds: |
| 1413 // WeakProperty | 1411 // WeakProperty |
| 1414 @Instance propertyValue [optional]; | 1412 @Instance propertyValue [optional]; |
| 1415 | 1413 |
| 1416 // The type arguments for this type. | 1414 // The type arguments for this type. |
| 1417 // | 1415 // |
| 1418 // Provided for instance kinds: | 1416 // Provided for instance kinds: |
| 1419 // Type | 1417 // Type |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1447 // TypeParameter | 1445 // TypeParameter |
| 1448 @Instance bound [optional]; | 1446 @Instance bound [optional]; |
| 1449 } | 1447 } |
| 1450 ``` | 1448 ``` |
| 1451 | 1449 |
| 1452 An _Instance_ represents an instance of the Dart language class _Object_. | 1450 An _Instance_ represents an instance of the Dart language class _Object_. |
| 1453 | 1451 |
| 1454 ### InstanceKind | 1452 ### InstanceKind |
| 1455 | 1453 |
| 1456 ``` | 1454 ``` |
| 1457 enum { | 1455 enum InstanceKind { |
| 1458 // A general instance of the Dart class Object. | 1456 // A general instance of the Dart class Object. |
| 1459 PlainInstance, | 1457 PlainInstance, |
| 1460 | 1458 |
| 1461 // null instance. | 1459 // null instance. |
| 1462 Null, | 1460 Null, |
| 1463 | 1461 |
| 1464 // true or false. | 1462 // true or false. |
| 1465 Bool, | 1463 Bool, |
| 1466 | 1464 |
| 1467 // An instance of the Dart class double. | 1465 // An instance of the Dart class double. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 ``` | 1697 ``` |
| 1700 | 1698 |
| 1701 A _Null_ object represents the Dart language value null. | 1699 A _Null_ object represents the Dart language value null. |
| 1702 | 1700 |
| 1703 ### Object | 1701 ### Object |
| 1704 | 1702 |
| 1705 ``` | 1703 ``` |
| 1706 class @Object extends Response { | 1704 class @Object extends Response { |
| 1707 // A unique identifier for an Object. Passed to the | 1705 // A unique identifier for an Object. Passed to the |
| 1708 // getObject RPC to load this Object. | 1706 // getObject RPC to load this Object. |
| 1709 string id | 1707 string id; |
| 1710 } | 1708 } |
| 1711 ``` | 1709 ``` |
| 1712 | 1710 |
| 1713 _@Object_ is a reference to a _Object_. | 1711 _@Object_ is a reference to a _Object_. |
| 1714 | 1712 |
| 1715 ``` | 1713 ``` |
| 1716 class Object extends Response { | 1714 class Object extends Response { |
| 1717 // A unique identifier for an Object. Passed to the | 1715 // A unique identifier for an Object. Passed to the |
| 1718 // getObject RPC to reload this Object. | 1716 // getObject RPC to reload this Object. |
| 1719 // | 1717 // |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 tokenPos | line | column | 1831 tokenPos | line | column |
| 1834 -------- | ---- | ------ | 1832 -------- | ---- | ------ |
| 1835 100 | 1 | 5 | 1833 100 | 1 | 5 |
| 1836 101 | 1 | 8 | 1834 101 | 1 | 8 |
| 1837 102 | 2 | 7 | 1835 102 | 2 | 7 |
| 1838 | 1836 |
| 1839 ### SourceLocation | 1837 ### SourceLocation |
| 1840 | 1838 |
| 1841 ``` | 1839 ``` |
| 1842 class SourceLocation extends Response { | 1840 class SourceLocation extends Response { |
| 1843 // The script contaiinging the source location. | 1841 // The script containing the source location. |
| 1844 @Script script; | 1842 @Script script; |
| 1845 | 1843 |
| 1846 // The first token of the location. | 1844 // The first token of the location. |
| 1847 int tokenPos; | 1845 int tokenPos; |
| 1848 | 1846 |
| 1849 // The last token of the location if this is a range. | 1847 // The last token of the location if this is a range. |
| 1850 int endTokenPos [optional]; | 1848 int endTokenPos [optional]; |
| 1851 } | 1849 } |
| 1852 ``` | 1850 ``` |
| 1853 | 1851 |
| 1854 The _SourceLocation_ class is used to designate a position or range in | 1852 The _SourceLocation_ class is used to designate a position or range in |
| 1855 some script. | 1853 some script. |
| 1856 | 1854 |
| 1857 ### Stack | 1855 ### Stack |
| 1858 | 1856 |
| 1859 ``` | 1857 ``` |
| 1860 class Stack { | 1858 class Stack extends Response { |
| 1861 Frame[] frames; | 1859 Frame[] frames; |
| 1862 Message[] messages; | 1860 Message[] messages; |
| 1863 } | 1861 } |
| 1864 ``` | 1862 ``` |
| 1865 | 1863 |
| 1866 ### StepOption | 1864 ### StepOption |
| 1867 | 1865 |
| 1868 ``` | 1866 ``` |
| 1869 enum StepOption { | 1867 enum StepOption { |
| 1870 Into, | 1868 Into, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 | 1955 |
| 1958 // The Dart VM version string. | 1956 // The Dart VM version string. |
| 1959 string version; | 1957 string version; |
| 1960 | 1958 |
| 1961 // The process id for the VM. | 1959 // The process id for the VM. |
| 1962 string pid; | 1960 string pid; |
| 1963 | 1961 |
| 1964 // The time that the VM started in milliseconds since the epoch. | 1962 // The time that the VM started in milliseconds since the epoch. |
| 1965 // | 1963 // |
| 1966 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. | 1964 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. |
| 1967 int startTime | 1965 int startTime; |
| 1968 | 1966 |
| 1969 // A list of isolates running in the VM. | 1967 // A list of isolates running in the VM. |
| 1970 @Isolate[] isolates | 1968 @Isolate[] isolates; |
| 1971 } | 1969 } |
| 1972 ``` | 1970 ``` |
| 1973 | 1971 |
| 1974 ## Revision History | 1972 ## Revision History |
| 1975 | 1973 |
| 1976 version | comments | 1974 version | comments |
| 1977 ------- | -------- | 1975 ------- | -------- |
| 1978 1.0 draft 1 | initial revision | 1976 1.0 draft 1 | initial revision |
| 1979 | 1977 |
| 1980 | 1978 |
| 1981 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss | 1979 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss |
| OLD | NEW |