Chromium Code Reviews| 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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 829 string name; | 829 string name; |
| 830 | 830 |
| 831 // What kind of code object is this? | 831 // What kind of code object is this? |
| 832 CodeKind kind; | 832 CodeKind kind; |
| 833 } | 833 } |
| 834 ``` | 834 ``` |
| 835 | 835 |
| 836 _@Code_ is a reference to a _Code_ object. | 836 _@Code_ is a reference to a _Code_ object. |
| 837 | 837 |
| 838 ``` | 838 ``` |
| 839 class @Code extends @Object { | 839 class Code extends @Object { |
|
devoncarew
2015/06/29 18:38:20
This is a dup of the above definition. Should this
turnidge
2015/06/29 22:07:01
This one is a bit odd, since it only differs in it
devoncarew
2015/06/29 22:22:22
Yup, totally. I just wanted to make sure that it w
turnidge
2015/06/29 22:55:36
Acknowledged.
| |
| 840 // A name for this code object. | 840 // A name for this code object. |
| 841 string name; | 841 string name; |
| 842 | 842 |
| 843 // What kind of code object is this? | 843 // What kind of code object is this? |
| 844 CodeKind kind; | 844 CodeKind kind; |
| 845 } | 845 } |
| 846 ``` | 846 ``` |
| 847 | 847 |
| 848 A _Code_ object represents compiled code in the Dart VM. | 848 A _Code_ object represents compiled code in the Dart VM. |
| 849 | 849 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1129 } | 1129 } |
| 1130 ``` | 1130 ``` |
| 1131 | 1131 |
| 1132 A _Flag_ represents a single VM command line flag. | 1132 A _Flag_ represents a single VM command line flag. |
| 1133 | 1133 |
| 1134 ### FlagList | 1134 ### FlagList |
| 1135 | 1135 |
| 1136 ``` | 1136 ``` |
| 1137 class FlagList extends Response { | 1137 class FlagList extends Response { |
| 1138 // A list of all flags which are set to default values. | 1138 // A list of all flags which are set to default values. |
| 1139 unmodifiedFlags []Flag | 1139 Flag[] unmodifiedFlags; |
| 1140 | 1140 |
| 1141 // A list of all flags which have been modified by the user. | 1141 // A list of all flags which have been modified by the user. |
| 1142 modifiedFlags []Flag | 1142 Flag[] modifiedFlags; |
| 1143 } | 1143 } |
| 1144 ``` | 1144 ``` |
| 1145 | 1145 |
| 1146 A _FlagList_ represents the complete set of VM command line flags. | 1146 A _FlagList_ represents the complete set of VM command line flags. |
| 1147 | 1147 |
| 1148 ### Frame | 1148 ### Frame |
| 1149 | 1149 |
| 1150 ``` | 1150 ``` |
| 1151 class Frame extends Response { | 1151 class Frame extends Response { |
| 1152 int index; | 1152 int index; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1163 ``` | 1163 ``` |
| 1164 class @Function extends @Object { | 1164 class @Function extends @Object { |
| 1165 // The name of this function. | 1165 // The name of this function. |
| 1166 string name; | 1166 string name; |
| 1167 | 1167 |
| 1168 // The owner of this field, which can be a Library, Class, or a | 1168 // The owner of this field, which can be a Library, Class, or a |
| 1169 // Function. | 1169 // Function. |
| 1170 @Library|@Class|@Function owner; | 1170 @Library|@Class|@Function owner; |
| 1171 | 1171 |
| 1172 // Is this function static? | 1172 // Is this function static? |
| 1173 bool static | 1173 bool static; |
| 1174 | 1174 |
| 1175 // Is this function const? | 1175 // Is this function const? |
| 1176 bool const; | 1176 bool const; |
| 1177 | |
| 1178 } | 1177 } |
| 1179 ``` | 1178 ``` |
| 1180 | 1179 |
| 1181 An _@Function_ is a reference to a _Function_. | 1180 An _@Function_ is a reference to a _Function_. |
| 1182 | 1181 |
| 1183 | 1182 |
| 1184 ``` | 1183 ``` |
| 1185 // A Dart language function. | |
|
devoncarew
2015/06/29 18:38:20
Already doc'd below, and none of the other definit
turnidge
2015/06/29 22:07:01
Acknowledged.
| |
| 1186 class Function extends Object { | 1184 class Function extends Object { |
| 1187 // The name of this function. | 1185 // The name of this function. |
| 1188 string name; | 1186 string name; |
| 1189 | 1187 |
| 1190 // The owner of this field, which can be a Library, Class, or a | 1188 // The owner of this field, which can be a Library, Class, or a |
| 1191 // Function. | 1189 // Function. |
| 1192 @Library|@Class|@Function owner; | 1190 @Library|@Class|@Function owner; |
| 1193 | 1191 |
| 1194 // The location of this function in the source code. | 1192 // The location of this function in the source code. |
| 1195 SourceLocation location [optional]; | 1193 SourceLocation location [optional]; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1262 // | 1260 // |
| 1263 // Provided for instance kinds: | 1261 // Provided for instance kinds: |
| 1264 // TypeParameter | 1262 // TypeParameter |
| 1265 @Class parameterizedClass [optional]; | 1263 @Class parameterizedClass [optional]; |
| 1266 | 1264 |
| 1267 | 1265 |
| 1268 // The pattern of a RegExp instance. | 1266 // The pattern of a RegExp instance. |
| 1269 // | 1267 // |
| 1270 // Provided for instance kinds: | 1268 // Provided for instance kinds: |
| 1271 // RegExp | 1269 // RegExp |
| 1272 @String pattern [optional]; | 1270 String pattern [optional]; |
| 1273 } | 1271 } |
| 1274 ``` | 1272 ``` |
| 1275 | 1273 |
| 1276 _@Instance_ is a reference to an _Instance_. | 1274 _@Instance_ is a reference to an _Instance_. |
| 1277 | 1275 |
| 1278 ``` | 1276 ``` |
| 1279 class Instance extends Object { | 1277 class Instance extends Object { |
| 1280 // What kind of instance is this? | 1278 // What kind of instance is this? |
| 1281 InstanceKind kind; | 1279 InstanceKind kind; |
| 1282 | 1280 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1384 // The referent of a MirrorReference instance. | 1382 // The referent of a MirrorReference instance. |
| 1385 // | 1383 // |
| 1386 // Provided for instance kinds: | 1384 // Provided for instance kinds: |
| 1387 // MirrorReference | 1385 // MirrorReference |
| 1388 @Instance mirrorReferent [optional]; | 1386 @Instance mirrorReferent [optional]; |
| 1389 | 1387 |
| 1390 // The pattern of a RegExp instance. | 1388 // The pattern of a RegExp instance. |
| 1391 // | 1389 // |
| 1392 // Provided for instance kinds: | 1390 // Provided for instance kinds: |
| 1393 // RegExp | 1391 // RegExp |
| 1394 @String pattern [optional]; | 1392 String pattern [optional]; |
| 1395 | 1393 |
| 1396 // The key for a WeakProperty instance. | 1394 // The key for a WeakProperty instance. |
| 1397 // | 1395 // |
| 1398 // Provided for instance kinds: | 1396 // Provided for instance kinds: |
| 1399 // WeakProperty | 1397 // WeakProperty |
| 1400 @Instance propertyKey [optional]; | 1398 @Instance propertyKey [optional]; |
| 1401 | 1399 |
| 1402 // The key for a WeakProperty instance. | 1400 // The key for a WeakProperty instance. |
| 1403 // | 1401 // |
| 1404 // Provided for instance kinds: | 1402 // Provided for instance kinds: |
| 1405 // WeakProperty | 1403 // WeakProperty |
| 1406 @Instance propertyValue [optional]; | 1404 @Instance propertyValue [optional]; |
| 1407 | 1405 |
| 1408 // The type arguments for this type. | 1406 // The type arguments for this type. |
| 1409 // | 1407 // |
| 1410 // Provided for instance kinds: | 1408 // Provided for instance kinds: |
| 1411 // Type | 1409 // Type |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1439 // TypeParameter | 1437 // TypeParameter |
| 1440 @Instance bound [optional]; | 1438 @Instance bound [optional]; |
| 1441 } | 1439 } |
| 1442 ``` | 1440 ``` |
| 1443 | 1441 |
| 1444 An _Instance_ represents an instance of the Dart language class _Object_. | 1442 An _Instance_ represents an instance of the Dart language class _Object_. |
| 1445 | 1443 |
| 1446 ### InstanceKind | 1444 ### InstanceKind |
| 1447 | 1445 |
| 1448 ``` | 1446 ``` |
| 1449 enum { | 1447 enum InstanceKind { |
| 1450 // A general instance of the Dart class Object. | 1448 // A general instance of the Dart class Object. |
| 1451 PlainInstance, | 1449 PlainInstance, |
| 1452 | 1450 |
| 1453 // null instance. | 1451 // null instance. |
| 1454 Null, | 1452 Null, |
| 1455 | 1453 |
| 1456 // true or false. | 1454 // true or false. |
| 1457 Bool, | 1455 Bool, |
| 1458 | 1456 |
| 1459 // An instance of the Dart class double. | 1457 // An instance of the Dart class double. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1691 ``` | 1689 ``` |
| 1692 | 1690 |
| 1693 A _Null_ object represents the Dart language value null. | 1691 A _Null_ object represents the Dart language value null. |
| 1694 | 1692 |
| 1695 ### Object | 1693 ### Object |
| 1696 | 1694 |
| 1697 ``` | 1695 ``` |
| 1698 class @Object extends Response { | 1696 class @Object extends Response { |
| 1699 // A unique identifier for an Object. Passed to the | 1697 // A unique identifier for an Object. Passed to the |
| 1700 // getObject RPC to load this Object. | 1698 // getObject RPC to load this Object. |
| 1701 string id | 1699 string id; |
| 1702 } | 1700 } |
| 1703 ``` | 1701 ``` |
| 1704 | 1702 |
| 1705 _@Object_ is a reference to a _Object_. | 1703 _@Object_ is a reference to a _Object_. |
| 1706 | 1704 |
| 1707 ``` | 1705 ``` |
| 1708 class Object extends Response { | 1706 class Object extends Response { |
| 1709 // A unique identifier for an Object. Passed to the | 1707 // A unique identifier for an Object. Passed to the |
| 1710 // getObject RPC to reload this Object. | 1708 // getObject RPC to reload this Object. |
| 1711 // | 1709 // |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1825 tokenPos | line | column | 1823 tokenPos | line | column |
| 1826 -------- | ---- | ------ | 1824 -------- | ---- | ------ |
| 1827 100 | 1 | 5 | 1825 100 | 1 | 5 |
| 1828 101 | 1 | 8 | 1826 101 | 1 | 8 |
| 1829 102 | 2 | 7 | 1827 102 | 2 | 7 |
| 1830 | 1828 |
| 1831 ### SourceLocation | 1829 ### SourceLocation |
| 1832 | 1830 |
| 1833 ``` | 1831 ``` |
| 1834 class SourceLocation extends Response { | 1832 class SourceLocation extends Response { |
| 1835 // The script contaiinging the source location. | 1833 // The script containing the source location. |
| 1836 @Script script; | 1834 @Script script; |
| 1837 | 1835 |
| 1838 // The first token of the location. | 1836 // The first token of the location. |
| 1839 int tokenPos; | 1837 int tokenPos; |
| 1840 | 1838 |
| 1841 // The last token of the location if this is a range. | 1839 // The last token of the location if this is a range. |
| 1842 int endTokenPos [optional]; | 1840 int endTokenPos [optional]; |
| 1843 } | 1841 } |
| 1844 ``` | 1842 ``` |
| 1845 | 1843 |
| 1846 The _SourceLocation_ class is used to designate a position or range in | 1844 The _SourceLocation_ class is used to designate a position or range in |
| 1847 some script. | 1845 some script. |
| 1848 | 1846 |
| 1849 ### Stack | 1847 ### Stack |
| 1850 | 1848 |
| 1851 ``` | 1849 ``` |
| 1852 class Stack { | 1850 class Stack extends Response { |
| 1853 Frame[] frames; | 1851 Frame[] frames; |
| 1854 Message[] messages; | 1852 Message[] messages; |
| 1855 } | 1853 } |
| 1856 ``` | 1854 ``` |
| 1857 | 1855 |
| 1858 ### StepOption | 1856 ### StepOption |
| 1859 | 1857 |
| 1860 ``` | 1858 ``` |
| 1861 enum StepOption { | 1859 enum StepOption { |
| 1862 Into, | 1860 Into, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1946 | 1944 |
| 1947 // The Dart VM version string. | 1945 // The Dart VM version string. |
| 1948 string version; | 1946 string version; |
| 1949 | 1947 |
| 1950 // The process id for the VM. | 1948 // The process id for the VM. |
| 1951 string pid; | 1949 string pid; |
| 1952 | 1950 |
| 1953 // The time that the VM started in milliseconds since the epoch. | 1951 // The time that the VM started in milliseconds since the epoch. |
| 1954 // | 1952 // |
| 1955 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. | 1953 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. |
| 1956 int startTime | 1954 int startTime; |
| 1957 | 1955 |
| 1958 // A list of isolates running in the VM. | 1956 // A list of isolates running in the VM. |
| 1959 @Isolate[] isolates | 1957 @Isolate[] isolates; |
| 1960 } | 1958 } |
| 1961 ``` | 1959 ``` |
| 1962 | 1960 |
| 1963 ## Revision History | 1961 ## Revision History |
| 1964 | 1962 |
| 1965 version | comments | 1963 version | comments |
| 1966 ------- | -------- | 1964 ------- | -------- |
| 1967 1.0 draft 1 | initial revision | 1965 1.0 draft 1 | initial revision |
| 1968 | 1966 |
| 1969 | 1967 |
| 1970 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato ry-discuss | 1968 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato ry-discuss |
| OLD | NEW |