| OLD | NEW |
| 1 # Dart VM Service Protocol 3.0 | 1 # Dart VM Service Protocol 3.0 |
| 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.0_ of the Dart VM Service Protocol. This | 5 This document describes of _version 3.0_ 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 Object|Sentinel getObject(string isolateId, | 491 Object|Sentinel getObject(string isolateId, |
| 492 string objectId) | 492 string objectId) |
| 493 ``` | 493 ``` |
| 494 | 494 |
| 495 The _getObject_ RPC is used to lookup an _object_ from some isolate by | 495 The _getObject_ RPC is used to lookup an _object_ from some isolate by |
| 496 its _id_. | 496 its _id_. |
| 497 | 497 |
| 498 If _objectId_ is a temporary id which has expired, then then _Expired_ | 498 If _objectId_ is a temporary id which has expired, then then _Expired_ |
| 499 [Sentinel](#sentinel) is returned. | 499 [Sentinel](#sentinel) is returned. |
| 500 | 500 |
| 501 If _objectId_ refers to an object which has been collected by the VM's | 501 If _objectId_ refers to a heap object which has been collected by the VM's |
| 502 garbage collector, then the _Collected_ [Sentinel](#sentinel) is | 502 garbage collector, then the _Collected_ [Sentinel](#sentinel) is |
| 503 returned. | 503 returned. |
| 504 | 504 |
| 505 If _objectId_ refers to a non-heap object which has been deleted, then |
| 506 the _Collected_ [Sentinel](#sentinel) is returned. |
| 507 |
| 505 If the object handle has not expired and the object has not been | 508 If the object handle has not expired and the object has not been |
| 506 collected, then an [Object](#object) will be returned. | 509 collected, then an [Object](#object) will be returned. |
| 507 | 510 |
| 508 ### getStack | 511 ### getStack |
| 509 | 512 |
| 510 ``` | 513 ``` |
| 511 Stack getStack(string isolateId) | 514 Stack getStack(string isolateId) |
| 512 ``` | 515 ``` |
| 513 | 516 |
| 514 The _getStack_ RPC is used to retrieve the current execution stack and | 517 The _getStack_ RPC is used to retrieve the current execution stack and |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 If the variable is being initialized, the _value_ will be the | 770 If the variable is being initialized, the _value_ will be the |
| 768 _BeingInitialized_ [Sentinel](#sentinel). | 771 _BeingInitialized_ [Sentinel](#sentinel). |
| 769 | 772 |
| 770 If the variable has been optimized out by the compiler, the _value_ | 773 If the variable has been optimized out by the compiler, the _value_ |
| 771 will be the _OptimizedOut_ [Sentinel](#sentinel). | 774 will be the _OptimizedOut_ [Sentinel](#sentinel). |
| 772 | 775 |
| 773 ### Breakpoint | 776 ### Breakpoint |
| 774 | 777 |
| 775 ``` | 778 ``` |
| 776 class Breakpoint extends Object { | 779 class Breakpoint extends Object { |
| 780 // A number identifying this breakpoint to the user. |
| 777 int breakpointNumber; | 781 int breakpointNumber; |
| 782 |
| 783 // Has this breakpoint been assigned to a specific program location? |
| 778 bool resolved; | 784 bool resolved; |
| 785 |
| 786 // SourceLocation when breakpoint is resolved, UnresolvedSourceLocation |
| 787 // when a breakpoint is not resolved. |
| 779 SourceLocation|UnresolvedSourceLocation location; | 788 SourceLocation|UnresolvedSourceLocation location; |
| 780 } | 789 } |
| 781 ``` | 790 ``` |
| 782 | 791 |
| 783 A _Breakpoint_ describes a debugger breakpoint. | 792 A _Breakpoint_ describes a debugger breakpoint. |
| 784 | 793 |
| 794 A breakpoint is _resolved_ when it has been assigned to a specific |
| 795 program location. A breakpoint my remain unresolved when it is in |
| 796 code which has not yet been compiled or in a library which has not |
| 797 been loaded (i.e. a deferred library). |
| 798 |
| 785 ### Class | 799 ### Class |
| 786 | 800 |
| 787 ``` | 801 ``` |
| 788 class @Class extends @Object { | 802 class @Class extends @Object { |
| 789 // The name of this class. | 803 // The name of this class. |
| 790 string name; | 804 string name; |
| 791 } | 805 } |
| 792 ``` | 806 ``` |
| 793 | 807 |
| 794 _@Class_ is a reference to a _Class_. | 808 _@Class_ is a reference to a _Class_. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 Native, | 892 Native, |
| 879 Stub, | 893 Stub, |
| 880 Tag, | 894 Tag, |
| 881 Collected | 895 Collected |
| 882 } | 896 } |
| 883 ``` | 897 ``` |
| 884 | 898 |
| 885 ### Context | 899 ### Context |
| 886 | 900 |
| 887 ``` | 901 ``` |
| 888 class @Context { | 902 class @Context extends @Object { |
| 889 // The number of variables in this context. | 903 // The number of variables in this context. |
| 890 int length; | 904 int length; |
| 891 } | 905 } |
| 892 ``` | 906 ``` |
| 893 | 907 |
| 894 ``` | 908 ``` |
| 895 class Context { | 909 class Context extends Object { |
| 896 // The number of variables in this context. | 910 // The number of variables in this context. |
| 897 int length; | 911 int length; |
| 898 | 912 |
| 899 // The enclosing context for this context. | 913 // The enclosing context for this context. |
| 900 Context parent [optional]; | 914 Context parent [optional]; |
| 901 | 915 |
| 902 // The variables in this context object. | 916 // The variables in this context object. |
| 903 ContextElement[] variables; | 917 ContextElement[] variables; |
| 904 } | 918 } |
| 905 ``` | 919 ``` |
| 906 | 920 |
| 921 A _Context_ is a data structure which holds the captured variables for |
| 922 some closure. |
| 923 |
| 907 ### ContextElement | 924 ### ContextElement |
| 908 | 925 |
| 909 ``` | 926 ``` |
| 910 class ContextElement { | 927 class ContextElement { |
| 911 @Instance|Sentinel value; | 928 @Instance|Sentinel value; |
| 912 } | 929 } |
| 913 ``` | 930 ``` |
| 914 | 931 |
| 915 ### Error | 932 ### Error |
| 916 | 933 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 | 1320 |
| 1304 // The parameterized class of a type parameter: | 1321 // The parameterized class of a type parameter: |
| 1305 // | 1322 // |
| 1306 // Provided for instance kinds: | 1323 // Provided for instance kinds: |
| 1307 // TypeParameter | 1324 // TypeParameter |
| 1308 @Class parameterizedClass [optional]; | 1325 @Class parameterizedClass [optional]; |
| 1309 | 1326 |
| 1310 | 1327 |
| 1311 // The pattern of a RegExp instance. | 1328 // The pattern of a RegExp instance. |
| 1312 // | 1329 // |
| 1330 // The pattern is always an instance of kind String. |
| 1331 // |
| 1313 // Provided for instance kinds: | 1332 // Provided for instance kinds: |
| 1314 // RegExp | 1333 // RegExp |
| 1315 String pattern [optional]; | 1334 @Instance pattern [optional]; |
| 1316 } | 1335 } |
| 1317 ``` | 1336 ``` |
| 1318 | 1337 |
| 1319 _@Instance_ is a reference to an _Instance_. | 1338 _@Instance_ is a reference to an _Instance_. |
| 1320 | 1339 |
| 1321 ``` | 1340 ``` |
| 1322 class Instance extends Object { | 1341 class Instance extends Object { |
| 1323 // What kind of instance is this? | 1342 // What kind of instance is this? |
| 1324 InstanceKind kind; | 1343 InstanceKind kind; |
| 1325 | 1344 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 @Instance|Sentinel[] elements [optional]; | 1407 @Instance|Sentinel[] elements [optional]; |
| 1389 | 1408 |
| 1390 // The elements of a List instance. | 1409 // The elements of a List instance. |
| 1391 // | 1410 // |
| 1392 // Provided for instance kinds: | 1411 // Provided for instance kinds: |
| 1393 // Map | 1412 // Map |
| 1394 MapAssociation[] associations [optional]; | 1413 MapAssociation[] associations [optional]; |
| 1395 | 1414 |
| 1396 // The bytes of a TypedData instance. | 1415 // The bytes of a TypedData instance. |
| 1397 // | 1416 // |
| 1417 // The data is provided as a Base64 encoded string. |
| 1418 // |
| 1398 // Provided for instance kinds: | 1419 // Provided for instance kinds: |
| 1399 // Uint8ClampedList | 1420 // Uint8ClampedList |
| 1400 // Uint8List | 1421 // Uint8List |
| 1401 // Uint16List | 1422 // Uint16List |
| 1402 // Uint32List | 1423 // Uint32List |
| 1403 // Uint64List | 1424 // Uint64List |
| 1404 // Int8List | 1425 // Int8List |
| 1405 // Int16List | 1426 // Int16List |
| 1406 // Int32List | 1427 // Int32List |
| 1407 // Int64List | 1428 // Int64List |
| 1408 // Float32List | 1429 // Float32List |
| 1409 // Float64List | 1430 // Float64List |
| 1410 // Int32x4List | 1431 // Int32x4List |
| 1411 // Float32x4List | 1432 // Float32x4List |
| 1412 // Float64x2List | 1433 // Float64x2List |
| 1413 int[] bytes [optional]; | 1434 string bytes [optional]; |
| 1414 | 1435 |
| 1415 // The function associated with a Closure instance. | 1436 // The function associated with a Closure instance. |
| 1416 // | 1437 // |
| 1417 // Provided for instance kinds: | 1438 // Provided for instance kinds: |
| 1418 // Closure | 1439 // Closure |
| 1419 @Function closureFunction [optional]; | 1440 @Function closureFunction [optional]; |
| 1420 | 1441 |
| 1421 // The context associated with a Closure instance. | 1442 // The context associated with a Closure instance. |
| 1422 // | 1443 // |
| 1423 // Provided for instance kinds: | 1444 // Provided for instance kinds: |
| 1424 // Closure | 1445 // Closure |
| 1425 @Function closureContext [optional]; | 1446 @Context closureContext [optional]; |
| 1426 | 1447 |
| 1427 // The referent of a MirrorReference instance. | 1448 // The referent of a MirrorReference instance. |
| 1428 // | 1449 // |
| 1429 // Provided for instance kinds: | 1450 // Provided for instance kinds: |
| 1430 // MirrorReference | 1451 // MirrorReference |
| 1431 @Instance mirrorReferent [optional]; | 1452 @Instance mirrorReferent [optional]; |
| 1432 | 1453 |
| 1433 // The pattern of a RegExp instance. | 1454 // The pattern of a RegExp instance. |
| 1434 // | 1455 // |
| 1435 // Provided for instance kinds: | 1456 // Provided for instance kinds: |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 ## Revision History | 2110 ## Revision History |
| 2090 | 2111 |
| 2091 version | comments | 2112 version | comments |
| 2092 ------- | -------- | 2113 ------- | -------- |
| 2093 1.0 draft 1 | initial revision | 2114 1.0 draft 1 | initial revision |
| 2094 1.1 | Describe protocol version 2.0. | 2115 1.1 | Describe protocol version 2.0. |
| 2095 1.2 | Describe protocol version 3.0. Added UnresolvedSourceLocation. | 2116 1.2 | Describe protocol version 3.0. Added UnresolvedSourceLocation. |
| 2096 | 2117 |
| 2097 | 2118 |
| 2098 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss | 2119 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observato
ry-discuss |
| OLD | NEW |