| OLD | NEW |
| (Empty) |
| 1 // <h2>Connecting to the VM Service</h2> | |
| 2 // | |
| 3 // TODO(turnidge): Describe how to connect, etc. | |
| 4 // | |
| 5 // <h2>Types</h2> | |
| 6 // | |
| 7 // Every non-error response returned by the VM Service has the | |
| 8 // <code>type</code> property. This allows the client distinguish | |
| 9 // between different kinds of responses. | |
| 10 // | |
| 11 // If the type name of a response begins with an <code>@</code> | |
| 12 // character then that response is a _reference_. If the type name of | |
| 13 // a response does not begin with an <code>@</code> character then | |
| 14 // that response is an _object_ (or sometimes _full object_). A | |
| 15 // reference is meant to be a subset of a full object with just enough | |
| 16 // information for the client to generate a reasonable-looking link. | |
| 17 // | |
| 18 // For example, an isolate reference may look like this... | |
| 19 // | |
| 20 // { | |
| 21 // type: "@Isolate", | |
| 22 // id: "isolates/123", | |
| 23 // name: "worker" | |
| 24 // } | |
| 25 // | |
| 26 // ... and a full isolate object would have additional properties: | |
| 27 // | |
| 28 // { | |
| 29 // type: "Isolate", | |
| 30 // id: "isolates/123", | |
| 31 // name: "worker" | |
| 32 // entry: ... | |
| 33 // heaps: ... | |
| 34 // topFrame: ... | |
| 35 // ... | |
| 36 // } | |
| 37 // | |
| 38 // <h2>IDs and Names</h2> | |
| 39 // | |
| 40 // Many responses returned by the VM Service have an <code>id</code> | |
| 41 // property. This is an identifier used to request an object from an | |
| 42 // isolate using the <code>getObject</code> rpc. If two responses | |
| 43 // have the same id then they refer to the same object. The converse | |
| 44 // is not true: the same object may occasionally be returned with two | |
| 45 // different ids. | |
| 46 // | |
| 47 // The client must not parse ids -- they must be treated as opaque | |
| 48 // strings. We reserve the right to change the ids of objects. | |
| 49 // | |
| 50 // TODO(turnidge): Describe id/handle expiration. Provide guidance on | |
| 51 // which responses are cacheable/constant. Perhaps this needs to be | |
| 52 // signaled in the Response itself. | |
| 53 // | |
| 54 // Many responses have the <code>name</code> property. Names are | |
| 55 // provided so that objects can be displayed in a way that a Dart | |
| 56 // language programmer would find sensible. | |
| 57 // | |
| 58 // Note that names are not unique. Many objects will have the same | |
| 59 // name. | |
| 60 // | |
| 61 // <h2>Private Properties</h2> | |
| 62 // | |
| 63 // Some properties returned by the VM Service begin with an underscore | |
| 64 // (_) character. These properties are called _private | |
| 65 // properties_. Private properties provide private information | |
| 66 // specific to the VM's implementation. Private properties may be | |
| 67 // added, removed, or changed at any time with any release of the VM. | |
| 68 // They are provided for those tools that need this level of internal | |
| 69 // access, such as the Observatory. | |
| 70 // | |
| 71 // For example, some responses will have the <code>_vmType</code> | |
| 72 // property. This provides the VM-internal type name of an object, | |
| 73 // and is provided only when this type name differs from the | |
| 74 // <code>type</code> property. | |
| 75 // | |
| 76 // <b>If your application relies on private properties, you should expect | |
| 77 // to update it when new versions of the VM are released.</b> | |
| 78 // | |
| 79 // <hr> | |
| 80 | |
| 81 interface Service { | |
| 82 // Returns global information about the Dart VM. | |
| 83 getVM() VM | |
| 84 | |
| 85 // Changes the debugging name for some isolate. | |
| 86 setName(isolateId string, name string) Response | |
| 87 | |
| 88 // Returns information about an isolate. | |
| 89 getIsolate(isolateId string) Isolate | |
| 90 | |
| 91 // Returns a list of vm flags and their values. | |
| 92 getFlagList() FlagList | |
| 93 | |
| 94 // Sets the value of a vm flag | |
| 95 setFlag(name string, value string) Response | |
| 96 | |
| 97 // Loads an object by id from an isolate. | |
| 98 getObject(isolateId string, objectId string) Object | |
| 99 | |
| 100 // The response is a subtype of Object or ObjectRef. | |
| 101 getObjectByAddress(address string, ref bool) Response | |
| 102 | |
| 103 // Adds a breakpoint at the specified line. | |
| 104 // | |
| 105 // TODO(turnidge): Make line an int instead of a string. | |
| 106 addBreakpoint(isolateId string, | |
| 107 scriptId string, | |
| 108 line string) Breakpoint | |
| 109 | |
| 110 // Adds a breakpoint at the entrypoint of the specified function. | |
| 111 addBreakpointAtEntry(isolateId string, | |
| 112 functionId string) Breakpoint | |
| 113 | |
| 114 // Removes the specified breakpoint | |
| 115 removeBreakpoint(isolateId string, breakpointId string) Response | |
| 116 | |
| 117 // Requests that an isolate pause execution. | |
| 118 pause(isolateId string) Response | |
| 119 | |
| 120 // Requests that an isolate resume execution. | |
| 121 // | |
| 122 // <code>step</code> is optional and indicates whether execution | |
| 123 // should single-step. | |
| 124 resume(isolateId string, step StepOption) Response | |
| 125 | |
| 126 // Evaluate an expression in the context of some target. | |
| 127 eval(isolateId string, targetId string, expression string) InstanceRef | |
| 128 | |
| 129 // Returns the current execution stack for an isolate. | |
| 130 // | |
| 131 // _full is an optional private parameter. | |
| 132 getStack(isolateId string, _full bool) Stack | |
| 133 | |
| 134 // Returns code coverage information for a library, script, class, | |
| 135 // or function. | |
| 136 getCoverage(isolateId string, targetId string) CodeCoverage | |
| 137 | |
| 138 // Returns call site cache information for a function. | |
| 139 _getCallSiteData(isolateId string, targetId string) _CallSiteData | |
| 140 | |
| 141 // Returns a full cpu profile for an isolate. | |
| 142 // | |
| 143 // <code>tagSelector</code> is optional with default 'UserVM'. | |
| 144 getCpuProfile(isolateId string, tags TagSelector) CpuProfile | |
| 145 | |
| 146 | |
| 147 // Returns a simple tag-based profile for an isolate. | |
| 148 getTagProfile(isolateId string) TagProfile | |
| 149 | |
| 150 // Returns an allocation profile for an isolate. | |
| 151 // | |
| 152 // <code>reset</code> is optional and indicates whether allocation | |
| 153 // accumulators should be reset. | |
| 154 // | |
| 155 // <code>gc</code> is optional and indicates whether a full | |
| 156 _getAllocationProfile(isolateId string, | |
| 157 reset bool, | |
| 158 gc GCOption) AllocationProfile | |
| 159 | |
| 160 // Returns the heap map for an isolate. | |
| 161 getHeapMap(isolateId string) HeapMap | |
| 162 | |
| 163 // Returns how many bytes are retained by some target Class or Instance. | |
| 164 _getRetainedSize(isolateId string, targetId string) InstanceRef | |
| 165 | |
| 166 // Returns a path demonstrating why an object is retained in memory. | |
| 167 // | |
| 168 // TODO(turnidge): Make limit an int instead of a string. | |
| 169 _getRetainingPath(isolateId string, | |
| 170 targetId string, | |
| 171 limit int) RetainingPath | |
| 172 | |
| 173 // Returns a collection of inbound references to some object. | |
| 174 // | |
| 175 // TODO(turnidge): Make limit an int instead of a string. | |
| 176 _getInboundReferences(isolateId string, | |
| 177 targetId string, | |
| 178 limit int) InboundReferences | |
| 179 | |
| 180 _getInstances(isolateId string, | |
| 181 classId string, | |
| 182 limit int) InstanceSet | |
| 183 | |
| 184 getClassList(isolateId string) ClassList | |
| 185 | |
| 186 // When <code>onlyWithInstantiations</code> is true, the list only includes | |
| 187 // type arguments with instantiations. Otherwise, all type arguments are | |
| 188 // returned. | |
| 189 getTypeArgumentsList(isolateId string, | |
| 190 onlyWithInstantiations bool) TypeArgumentsList | |
| 191 | |
| 192 // Gets a list of isolate metrics. | |
| 193 getIsolateMetricList(isolateId string, | |
| 194 type MetricSelector) MetricList | |
| 195 | |
| 196 // Gets a specific isolate metric by id. | |
| 197 getIsolateMetric(isolateId string, | |
| 198 metricId string) Metric | |
| 199 | |
| 200 // Gets a list of vm metrics. | |
| 201 getVMMetricList() MetricList | |
| 202 | |
| 203 // Gets a specific vm metric by id. | |
| 204 getVMMetric(metricId string) Metric | |
| 205 | |
| 206 // A test rpc for vm requests. | |
| 207 _echoVM(text string) _EchoResponse | |
| 208 | |
| 209 // A test rpc for isolate requests. | |
| 210 _echo(isolateId string, | |
| 211 text string) _EchoResponse | |
| 212 | |
| 213 // Triggers a ServiceEvent with EventType '_Echo'. | |
| 214 _triggerEchoEvent(isolateId string, | |
| 215 text string) _EchoResponse | |
| 216 | |
| 217 // Response is bad JSON. | |
| 218 _respondWithMalformedJson(isolateId string) Response | |
| 219 | |
| 220 // Response is not an object. | |
| 221 _respondWithMalformedObject(isolateId string) Response | |
| 222 } | |
| 223 | |
| 224 | |
| 225 // Every non-error top level response returned by the Service | |
| 226 // interface extends <code>Response</code>. This allows the client to | |
| 227 // distinguish between different kinds of responses by using the | |
| 228 // <code>type</code> property. | |
| 229 struct Response { | |
| 230 // Every response returned by the VM Service has the | |
| 231 // <code>type</code> property. This allows the client distinguish | |
| 232 // between different kinds of responses. | |
| 233 type string | |
| 234 | |
| 235 // Some responses will have the <code>_vmType</code> property. This | |
| 236 // provides the VM-internal type name of an object, and is provided | |
| 237 // only when this type name differs from the <code>type</code> | |
| 238 // property. | |
| 239 _vmType string [optional] | |
| 240 } | |
| 241 | |
| 242 | |
| 243 // An asynchronous notification from the VM Service. | |
| 244 struct ServiceEvent extends Response { | |
| 245 // What kind of event is this? | |
| 246 eventType ServiceEventType | |
| 247 | |
| 248 // The isolate with which this event is associated. | |
| 249 isolate IsolateRef | |
| 250 | |
| 251 // The breakpoint associated with this event, if applicable. | |
| 252 // | |
| 253 // This is provided for the events: | |
| 254 // <code>PauseBreakpoint</code> | |
| 255 // <code>BreakpointAdded</code> | |
| 256 // <code>BreakpointRemoved</code> | |
| 257 // <code>BreakpointResolved</code> | |
| 258 breakpoint Breakpoint [optional] | |
| 259 | |
| 260 // The top stack frame associated with this event, if applicable. | |
| 261 // | |
| 262 // This is provided for the events: | |
| 263 // <code>PauseBreakpoint</code> | |
| 264 // <code>PauseInterrupted</code> | |
| 265 // <code>PauseException</code> | |
| 266 // | |
| 267 // For the <code>Resume</code> event, the top frame is provided at | |
| 268 // all times except for the initial resume event that is delivered | |
| 269 // when an isolate begins execution. | |
| 270 topFrame Frame [optional] | |
| 271 | |
| 272 // The exception associated with this event, if this is a | |
| 273 // <code>PauseException</code> event. | |
| 274 exception InstanceRef [optional] | |
| 275 } | |
| 276 | |
| 277 | |
| 278 // The type of a service event. | |
| 279 enum ServiceEventType { | |
| 280 // Notification that a new isolate has started. | |
| 281 IsolateStart | |
| 282 | |
| 283 // Notification that an isolate has exited. | |
| 284 IsolateExit | |
| 285 | |
| 286 // Notification that isolate identifying information has changed. | |
| 287 // Currently used to notify of changes to the isolate debugging name | |
| 288 // via <code>setName</code>. | |
| 289 IsolateUpdate | |
| 290 | |
| 291 // An isolate has paused at start, before executing code. | |
| 292 PauseStart | |
| 293 | |
| 294 // An isolate has paused at exit, before terminating. | |
| 295 PauseExit | |
| 296 | |
| 297 // An isolate has paused at a breakpoint or due to stepping. | |
| 298 PauseBreakpoint | |
| 299 | |
| 300 // An isolate has paused due to interruption via <code>pause</code>. | |
| 301 PauseInterrupted | |
| 302 | |
| 303 // An isolate has paused due to an exception. | |
| 304 // | |
| 305 // TODO(turnidge): Allow user to toggle pause-on-exceptions. | |
| 306 PauseException | |
| 307 | |
| 308 // An isolate has started or resumed execution. | |
| 309 Resume | |
| 310 | |
| 311 // A breakpoint has been added for an isolate. | |
| 312 BreakpointAdded | |
| 313 | |
| 314 // An unresolved breakpoint has been resolved for an isolate. | |
| 315 BreakpointResolved | |
| 316 | |
| 317 // A breakpoint has been removed. | |
| 318 BreakpointRemoved | |
| 319 | |
| 320 // A garbage collection event. | |
| 321 GC | |
| 322 | |
| 323 // The object graph is being delivered. This is triggered via | |
| 324 // <code>requestHeapSnapshot</code>. | |
| 325 _Graph | |
| 326 } | |
| 327 | |
| 328 | |
| 329 struct VM extends Response { | |
| 330 // Word length on target architecture (e.g. 32, 64). | |
| 331 architectureBits int | |
| 332 | |
| 333 // The CPU we are generating code for. | |
| 334 targetCPU string | |
| 335 | |
| 336 // The CPU we are actually running on. | |
| 337 hostCPU string | |
| 338 | |
| 339 // The Dart VM version string. | |
| 340 version string | |
| 341 | |
| 342 // The process id for the VM. | |
| 343 pid string | |
| 344 | |
| 345 // The time that the VM started in milliseconds since the epoch. | |
| 346 // | |
| 347 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. | |
| 348 startTime int | |
| 349 | |
| 350 // A list of isolates running in the VM. | |
| 351 isolates []IsolateRef | |
| 352 | |
| 353 // Are assertions enabled in the VM? | |
| 354 // | |
| 355 // TODO(turnidge): Move to some sort of general settings list? | |
| 356 _assertsEnabled bool | |
| 357 | |
| 358 // Are type checks enabled in the VM? | |
| 359 // | |
| 360 // TODO(turnidge): Move to some sort of general settings list? | |
| 361 _typeChecksEnabled bool | |
| 362 } | |
| 363 | |
| 364 | |
| 365 // A reference to an an isolate. | |
| 366 struct IsolateRef extends Object { | |
| 367 // A numeric id for this isolate, represented as a string. Unique. | |
| 368 number string | |
| 369 | |
| 370 // A name identifying this isolate. Not guaranteed to be unique. | |
| 371 name string | |
| 372 } | |
| 373 | |
| 374 | |
| 375 // An isolate running in the VM. | |
| 376 struct Isolate { | |
| 377 // A numeric id for this isolate, represented as a string. Unique. | |
| 378 number string | |
| 379 | |
| 380 // A name identifying this isolate. Not guaranteed to be unique. | |
| 381 name string | |
| 382 | |
| 383 // The time that the VM started in milliseconds since the epoch. | |
| 384 // | |
| 385 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. | |
| 386 startTime int | |
| 387 | |
| 388 // The entry function for this isolate. | |
| 389 entry FunctionRef [optional] | |
| 390 | |
| 391 // The number of live ports for this isolate. | |
| 392 livePorts int | |
| 393 | |
| 394 // Will this isolate pause when exiting? | |
| 395 pauseOnExit bool | |
| 396 | |
| 397 // The last pause event delivered to the isolate. If the isolate is | |
| 398 // running, this will be a resume event. | |
| 399 pauseEvent ServiceEvent | |
| 400 | |
| 401 // The error that is causing this isolate to exit, if applicable. | |
| 402 error Error [optional] | |
| 403 | |
| 404 // The root library for this isolate. | |
| 405 rootLib LibraryRef | |
| 406 | |
| 407 // A list of all libraries for this isolate. | |
| 408 libraries []LibraryRef | |
| 409 | |
| 410 // A list of all breakpoints for this isolate. | |
| 411 breakpoints []Breakpoint | |
| 412 | |
| 413 // A list of features enabled for this isolate. | |
| 414 features []string | |
| 415 | |
| 416 // TODO | |
| 417 heaps int | |
| 418 | |
| 419 // TODO | |
| 420 tagCounters int | |
| 421 } | |
| 422 | |
| 423 | |
| 424 // A list of flags. | |
| 425 struct FlagList extends Response { | |
| 426 // A list of all flags which are set to default values. | |
| 427 unmodifiedFlags []Flag | |
| 428 | |
| 429 // A list of all flags which have been modified by the user. | |
| 430 modifiedFlags []Flag | |
| 431 } | |
| 432 | |
| 433 | |
| 434 // A single flag. | |
| 435 struct Flag { | |
| 436 // The name of the flag. | |
| 437 name string | |
| 438 | |
| 439 // A description of the flag. | |
| 440 comment string | |
| 441 | |
| 442 // The type of the flag. | |
| 443 flagType FlagType | |
| 444 } | |
| 445 | |
| 446 | |
| 447 // The type of a flag. | |
| 448 enum FlagType { | |
| 449 bool | |
| 450 int | |
| 451 uint64_t | |
| 452 string | |
| 453 } | |
| 454 | |
| 455 | |
| 456 // A reference to a persistent object that lives in some isolate. | |
| 457 struct ObjectRef extends Response { | |
| 458 // A unique identifier for an object. Passed to | |
| 459 // <code>getObject</code> to load the full object. | |
| 460 id string | |
| 461 } | |
| 462 | |
| 463 | |
| 464 // A persistent object that lives in some isolate. | |
| 465 struct Object extends Response { | |
| 466 // A unique identifier for this object. | |
| 467 id string | |
| 468 } | |
| 469 | |
| 470 | |
| 471 // TODO(turnidge): null type | |
| 472 // TODO(turnidge): VMObject. | |
| 473 | |
| 474 | |
| 475 // A reference to a Dart language library. | |
| 476 struct LibraryRef extends ObjectRef { | |
| 477 // The name of this library. | |
| 478 name string | |
| 479 | |
| 480 // The url of this library. | |
| 481 url string | |
| 482 } | |
| 483 | |
| 484 | |
| 485 // A Dart language library. | |
| 486 struct Library extends Object { | |
| 487 // The name of this library. | |
| 488 name string | |
| 489 | |
| 490 // The url of this library. | |
| 491 url string | |
| 492 | |
| 493 // A list of the imports for this library. | |
| 494 imports []LibraryRef | |
| 495 | |
| 496 // A list of the scripts which constitute this library. | |
| 497 scripts []ScriptRef | |
| 498 | |
| 499 // A list of the top-level variables in this library. | |
| 500 variables []FieldRef | |
| 501 | |
| 502 // A list of the top-level functions in this library. | |
| 503 functions []FunctionRef | |
| 504 | |
| 505 // A list of all classes in this library. | |
| 506 classes []ClassRef | |
| 507 } | |
| 508 | |
| 509 | |
| 510 // A reference to a Dart language script. | |
| 511 struct ScriptRef extends ObjectRef { | |
| 512 // A name for this script. | |
| 513 name string | |
| 514 | |
| 515 // What kind of script is this? | |
| 516 kind ScriptKind | |
| 517 } | |
| 518 | |
| 519 | |
| 520 // A Dart language script. | |
| 521 struct Script extends Object { | |
| 522 // A name for this script. | |
| 523 name string | |
| 524 | |
| 525 // What kind of script is this? | |
| 526 kind ScriptKind | |
| 527 | |
| 528 // The library which owns this script. | |
| 529 library LibraryRef | |
| 530 | |
| 531 // The source code for this script. For certain built-in scripts, | |
| 532 // this may be reconstructed without source comments. | |
| 533 source string | |
| 534 | |
| 535 // A table encoding a mapping from token position to line and column. | |
| 536 // | |
| 537 // Each entry in the array consists of a line number followed by | |
| 538 // (tokenPos, columnNumber) pairs: | |
| 539 // | |
| 540 // [lineNumber, (tokenPos, columnNumber)*] | |
| 541 // | |
| 542 // For example, the following table: | |
| 543 // | |
| 544 // [[1, 100, 5, 101, 8],[2, 102, 7]] | |
| 545 // | |
| 546 // Encodes the following mapping: | |
| 547 // | |
| 548 // tokenPos line column | |
| 549 // -------- ------ ------ | |
| 550 // 100 1 5 | |
| 551 // 101 1 8 | |
| 552 // 102 2 7 | |
| 553 // | |
| 554 // TODO(turnidge): The tool I'm using does not support [][]. | |
| 555 // tokenPosTable [][]int | |
| 556 tokenPosTable int | |
| 557 } | |
| 558 | |
| 559 | |
| 560 enum ScriptKind { | |
| 561 script | |
| 562 library | |
| 563 source | |
| 564 patch | |
| 565 } | |
| 566 | |
| 567 | |
| 568 // A reference to a Dart language class. | |
| 569 struct ClassRef extends ObjectRef { | |
| 570 // The name of this class. | |
| 571 name string | |
| 572 | |
| 573 // A vm internal name, provided only when it is different than name. | |
| 574 _vmName string [optional] | |
| 575 } | |
| 576 | |
| 577 | |
| 578 // A Dart language class. | |
| 579 struct Class extends Object { | |
| 580 // The name of this class. | |
| 581 name string | |
| 582 | |
| 583 // A vm internal name, provided only when it is different than name. | |
| 584 _vmName string [optional] | |
| 585 | |
| 586 // The error which occurred during class finalization, if it exists. | |
| 587 error InstanceRef [optional] | |
| 588 | |
| 589 // Is this an abstract class? | |
| 590 abstract bool | |
| 591 | |
| 592 // Is this a const class? | |
| 593 const bool | |
| 594 | |
| 595 // Has this class been finalized? | |
| 596 finalized bool | |
| 597 | |
| 598 // Is this class implemented? | |
| 599 implemented bool | |
| 600 | |
| 601 // Is this a vm patch class? | |
| 602 patch bool | |
| 603 | |
| 604 // The library which contains this class. | |
| 605 library LibraryRef | |
| 606 | |
| 607 // The script which defines this class. May be missing for some | |
| 608 // classes. | |
| 609 script ScriptRef | |
| 610 | |
| 611 // The superclass of this class, if any. | |
| 612 super ClassRef [optional] | |
| 613 | |
| 614 // A list of interface types for this class. | |
| 615 interfaces []TypeRef | |
| 616 | |
| 617 // A list of fields in this class. Does not include fields from | |
| 618 // superclasses. | |
| 619 fields []FieldRef | |
| 620 | |
| 621 // A list of functions in this class. Does not include functions | |
| 622 // from superclasses. | |
| 623 functions []FunctionRef | |
| 624 | |
| 625 // A list of subclasses of this class. | |
| 626 subclasses []ClassRef | |
| 627 | |
| 628 // Allocation statistics for this class, if available. | |
| 629 allocationStats ClassHeapStats [optional] | |
| 630 } | |
| 631 | |
| 632 | |
| 633 struct ClassHeapStats extends Response { | |
| 634 TODO int | |
| 635 } | |
| 636 | |
| 637 | |
| 638 // A reference to a Dart language field or variable. | |
| 639 struct FieldRef extends ObjectRef { | |
| 640 // The name of this field. | |
| 641 name string | |
| 642 | |
| 643 // A vm internal name, provided only when it is different than name. | |
| 644 _vmName string [optional] | |
| 645 | |
| 646 // The value of this field, if the field is static. | |
| 647 value InstanceRef [optional] | |
| 648 | |
| 649 // The owner of this field, which can be either a LibraryRef for a | |
| 650 // ClassRef. | |
| 651 owner ObjectRef | |
| 652 | |
| 653 // The declared type of this field. | |
| 654 declaredType TypeRef | |
| 655 | |
| 656 // Is this field const? | |
| 657 const bool | |
| 658 | |
| 659 // Is this field final? | |
| 660 final bool | |
| 661 | |
| 662 // Is this field static? | |
| 663 static bool | |
| 664 } | |
| 665 | |
| 666 | |
| 667 // A Dart language field or variable. | |
| 668 struct Field extends ObjectRef { | |
| 669 // The name of this field. | |
| 670 name string | |
| 671 | |
| 672 // A vm internal name, provided only when it is different than name. | |
| 673 _vmName string [optional] | |
| 674 | |
| 675 // The value of this field, if the field is static. | |
| 676 value InstanceRef [optional] | |
| 677 | |
| 678 // The owner of this field, which can be either a LibraryRef for a | |
| 679 // ClassRef. | |
| 680 owner ObjectRef | |
| 681 | |
| 682 // The declared type of this field. | |
| 683 declaredType TypeRef | |
| 684 | |
| 685 // Is this field const? | |
| 686 const bool | |
| 687 | |
| 688 // Is this field final? | |
| 689 final bool | |
| 690 | |
| 691 // Is this field static? | |
| 692 static bool | |
| 693 | |
| 694 // The script containing this feild. | |
| 695 script ScriptRef [optional] | |
| 696 | |
| 697 // The token position of this field. | |
| 698 tokenPos int [optional] | |
| 699 | |
| 700 // Have we seen null assigned to this field? | |
| 701 _guardNullable bool | |
| 702 | |
| 703 // Have we seen a single class assigned to this field? | |
| 704 // | |
| 705 // TODO(johnmccutchan): This can actually be a string 'unknown' or | |
| 706 // 'dynamic' or a ClassRef. Change how this is encoded. | |
| 707 _guardClass string | |
| 708 | |
| 709 // Have we seen a fixed length list assigned to this field? | |
| 710 // | |
| 711 // TODO(johnmccutchan): This can actually be a string 'unknown' or | |
| 712 // 'dynamic' or a ClassRef. Change how this is encoded. | |
| 713 _guardLength string | |
| 714 } | |
| 715 | |
| 716 | |
| 717 // A reference to a Dart language function. | |
| 718 struct FunctionRef extends ObjectRef { | |
| 719 // The name of this function. | |
| 720 name string | |
| 721 | |
| 722 // A vm internal name, provided only when it is different than name. | |
| 723 _vmName string [optional] | |
| 724 | |
| 725 // The owner of this field, which can be a LibraryRef, ClassRef, or | |
| 726 // a FunctionRef. | |
| 727 owner ObjectRef | |
| 728 | |
| 729 // What kind of function is this? | |
| 730 kind FunctionKind | |
| 731 } | |
| 732 | |
| 733 | |
| 734 // A Dart language function. | |
| 735 struct Function extends ObjectRef { | |
| 736 // The name of this function. | |
| 737 name string | |
| 738 | |
| 739 // A vm internal name, provided only when it is different than name. | |
| 740 _vmName string [optional] | |
| 741 | |
| 742 // What kind of function is this? | |
| 743 kind FunctionKind | |
| 744 | |
| 745 // The owner of this field, which can be a LibraryRef, ClassRef, or | |
| 746 // a FunctionRef. | |
| 747 owner ObjectRef | |
| 748 | |
| 749 // Is this function static? | |
| 750 // | |
| 751 // TODO(turnidge): This is inconsistent with FieldRef. | |
| 752 static bool | |
| 753 | |
| 754 // Is this function const? | |
| 755 const bool | |
| 756 | |
| 757 // The script containing this function. | |
| 758 script ScriptRef [optional] | |
| 759 | |
| 760 // The first token position of this function. | |
| 761 tokenPos int [optional] | |
| 762 | |
| 763 // The last token position of this function. | |
| 764 endTokenPos int [optional] | |
| 765 | |
| 766 // The compiled code associated with this function. | |
| 767 code CodeRef [optional] | |
| 768 | |
| 769 // Are we able to generate optimized code for this function? | |
| 770 _optimizable bool | |
| 771 | |
| 772 // Are we able to inline this function? | |
| 773 _inlinable bool | |
| 774 | |
| 775 // The unoptimized version of this function, if retained. | |
| 776 _unoptimizedCode CodeRef [optional] | |
| 777 | |
| 778 // An indicator of how actively this function is used. | |
| 779 _usageCounter int | |
| 780 | |
| 781 // TODO(johnmccutchan): Document. | |
| 782 _optimizedCallSiteCount int | |
| 783 | |
| 784 // How many times has this function been deoptimized? | |
| 785 _deoptimizations int | |
| 786 } | |
| 787 | |
| 788 | |
| 789 enum FunctionKind { | |
| 790 RegularFunction | |
| 791 ClosureFunction | |
| 792 GetterFunction | |
| 793 SetterFunction | |
| 794 Constructor | |
| 795 ImplicitGetter | |
| 796 ImplicitSetter | |
| 797 ImplicitStaticFinalGetter | |
| 798 IrregexpFunction | |
| 799 StaticInitializer | |
| 800 MethodExtractor | |
| 801 NoSuchMethodDispatcher | |
| 802 InvokeFieldDispatcher | |
| 803 Collected | |
| 804 Native | |
| 805 Stub | |
| 806 Tag | |
| 807 } | |
| 808 | |
| 809 | |
| 810 // A reference to a compiled code object in the Dart VM. | |
| 811 struct CodeRef extends ObjectRef { | |
| 812 // A name for this code object | |
| 813 name string | |
| 814 | |
| 815 // A vm internal name, provided only when it is different than name. | |
| 816 _vmName string [optional] | |
| 817 | |
| 818 // What kind of code object is this? | |
| 819 kind CodeKind | |
| 820 | |
| 821 // Was this code generated using the optimizing compiler? | |
| 822 _optimized bool | |
| 823 } | |
| 824 | |
| 825 | |
| 826 // A compiled code object in the Dart VM. | |
| 827 struct Code extends Object { | |
| 828 // A name for this code object | |
| 829 name string | |
| 830 | |
| 831 // A vm internal name, provided only when it is different than name. | |
| 832 _vmName string [optional] | |
| 833 | |
| 834 // What kind of code object is this? | |
| 835 kind CodeKind | |
| 836 | |
| 837 // Was this code generated using the optimizing compiler? | |
| 838 _optimized bool | |
| 839 | |
| 840 // The function which corresponds to this compiled code. | |
| 841 function FunctionRef | |
| 842 | |
| 843 // The start address of the generated code as a hex string. | |
| 844 _startAddress string | |
| 845 | |
| 846 // The end address of the generated code as a hex string. | |
| 847 _endAddress string | |
| 848 | |
| 849 // The object pool associated with this code object. | |
| 850 _objectPool UNDOCUMENTED [optional] | |
| 851 | |
| 852 // The disassembly of this code object. | |
| 853 _disassembly UNDOCUMENTED [optional] | |
| 854 | |
| 855 // The pc descriptor table for this code object. | |
| 856 _descriptors UNDOCUMENTED [optional] | |
| 857 | |
| 858 // The inlined function table for this code object. | |
| 859 _inlinedFunctions UNDOCUMENTED [optional] | |
| 860 | |
| 861 // Inline interval information for this code object. | |
| 862 _inlinedIntervals UNDOCUMENTED [optional] | |
| 863 } | |
| 864 | |
| 865 | |
| 866 enum CodeKind { | |
| 867 Dart | |
| 868 Native | |
| 869 Stub | |
| 870 Tag | |
| 871 Collected | |
| 872 } | |
| 873 | |
| 874 | |
| 875 // A reference to a type arguments vector. | |
| 876 struct TypeArgumentsRef extends ObjectRef { | |
| 877 // A name for this type argument list. | |
| 878 name string | |
| 879 | |
| 880 // A vm internal name, provided only when it is different than name. | |
| 881 _vmName string | |
| 882 } | |
| 883 | |
| 884 | |
| 885 // The type argument vector for some instantiated generic type. | |
| 886 struct TypeArguments extends Object { | |
| 887 // A name for this type argument list. | |
| 888 name string | |
| 889 | |
| 890 // A vm internal name, provided only when it is different than name. | |
| 891 _vmName string | |
| 892 | |
| 893 // A list of types. | |
| 894 types []TypeRef | |
| 895 } | |
| 896 | |
| 897 | |
| 898 // Represents an error object inside the VM. | |
| 899 struct Error extends Object { | |
| 900 // An error message | |
| 901 message string | |
| 902 } | |
| 903 | |
| 904 | |
| 905 // A <code>InstanceRef</code> encodes a reference to a | |
| 906 // <code>Instance</code> object. | |
| 907 struct InstanceRef extends ObjectRef { | |
| 908 TODO int | |
| 909 } | |
| 910 | |
| 911 | |
| 912 struct TypeRef extends InstanceRef { | |
| 913 TODO2 int | |
| 914 } | |
| 915 | |
| 916 | |
| 917 // An <code>Instance</code> represents a Dart-language object. | |
| 918 struct Instance extends Object { | |
| 919 TODO int | |
| 920 } | |
| 921 | |
| 922 | |
| 923 // A <code>Breakpoint</code> describes a debugger breakpoint. | |
| 924 struct Breakpoint extends Object { | |
| 925 breakpointNumber int | |
| 926 resolved bool | |
| 927 location Location | |
| 928 } | |
| 929 | |
| 930 | |
| 931 // A <code>Location</code> encodes a location withing a dart script. | |
| 932 // | |
| 933 // TODO(turnidge): Should this really be broken out as its own type? | |
| 934 // If so, we should use it more consistently in the api. For example, | |
| 935 // in Frame. | |
| 936 struct Location { | |
| 937 script ScriptRef | |
| 938 tokenPos int | |
| 939 } | |
| 940 | |
| 941 | |
| 942 // A <code>Variable</code> represents one name/value pair from a frame. | |
| 943 struct Variable { | |
| 944 name string | |
| 945 value InstanceRef | |
| 946 } | |
| 947 | |
| 948 | |
| 949 // A <code>Frame</code> represents one frame from an isolate's stack. | |
| 950 struct Frame { | |
| 951 script ScriptRef | |
| 952 tokenPos int | |
| 953 function FunctionRef | |
| 954 code CodeRef | |
| 955 vars []Variable | |
| 956 } | |
| 957 | |
| 958 | |
| 959 // A <code>Stack</code> represents an isolate's execution stack. | |
| 960 struct Stack extends Response { | |
| 961 frames []Frame | |
| 962 } | |
| 963 | |
| 964 | |
| 965 struct CodeCoverage extends Response { | |
| 966 TODO int | |
| 967 } | |
| 968 | |
| 969 | |
| 970 struct _CacheEntry { | |
| 971 receiverClass ClassRef | |
| 972 count int | |
| 973 } | |
| 974 | |
| 975 | |
| 976 struct _CallSite { | |
| 977 name string | |
| 978 line int | |
| 979 column int | |
| 980 cacheEntries []_CacheEntry | |
| 981 } | |
| 982 | |
| 983 | |
| 984 struct _CallSiteData extends Response { | |
| 985 function FunctionRef | |
| 986 callSites []_CallSite | |
| 987 } | |
| 988 | |
| 989 // A <code>TagProfile</code> is a limited profile encoded as parallel | |
| 990 // arrays of tag names and tag values. | |
| 991 struct TagProfile extends Response { | |
| 992 names []string | |
| 993 counters []int | |
| 994 } | |
| 995 | |
| 996 | |
| 997 // An <code>AllocationProfile</code> encodes an allocation profile. | |
| 998 struct AllocationProfile extends Response { | |
| 999 todo int | |
| 1000 } | |
| 1001 | |
| 1002 | |
| 1003 // A <code>CpuProfile</code> encodes a full cpu profile. | |
| 1004 struct CpuProfile extends Response { | |
| 1005 samples int | |
| 1006 depth int | |
| 1007 period int | |
| 1008 timeSpan float | |
| 1009 exclusive_trie []int | |
| 1010 codes []CodeRegion | |
| 1011 } | |
| 1012 | |
| 1013 | |
| 1014 // A <code>CodeRegion</code> represents profiling information for a | |
| 1015 // specific <code>Code</code> object. | |
| 1016 struct CodeRegion { | |
| 1017 kind string | |
| 1018 inclusive_ticks int | |
| 1019 exclusive_ticks int | |
| 1020 code CodeRef | |
| 1021 ticks []int | |
| 1022 callers []int | |
| 1023 } | |
| 1024 | |
| 1025 // An <code>HeapMap</code> provides a memory view of all heap allocated objects. | |
| 1026 struct HeapMap extends Response { | |
| 1027 todo int | |
| 1028 } | |
| 1029 | |
| 1030 | |
| 1031 // An <code>HeapMap</code> provides a memory view of all heap allocated objects. | |
| 1032 struct RetainingPath extends Response { | |
| 1033 length int | |
| 1034 elements []RetainingPathElement | |
| 1035 } | |
| 1036 | |
| 1037 | |
| 1038 // One entry in a <code>RetainingPath</code>. | |
| 1039 struct RetainingPathElement { | |
| 1040 index int | |
| 1041 element InstanceRef | |
| 1042 parentListIndex int [optional] | |
| 1043 parentField FieldRef [optional] | |
| 1044 } | |
| 1045 | |
| 1046 | |
| 1047 struct InboundReferences extends Response { | |
| 1048 length int | |
| 1049 references []InboundReference | |
| 1050 } | |
| 1051 | |
| 1052 | |
| 1053 // TODO(koda): slot can actually be a string, and integer or a | |
| 1054 // FieldRef. Fix this to be consistent with RetainingPathElement. | |
| 1055 struct InboundReference { | |
| 1056 source InstanceRef | |
| 1057 slot int | |
| 1058 } | |
| 1059 | |
| 1060 | |
| 1061 struct InstanceSet { | |
| 1062 placeholder int | |
| 1063 } | |
| 1064 | |
| 1065 | |
| 1066 struct ClassList extends Response { | |
| 1067 classes []ClassRef | |
| 1068 } | |
| 1069 | |
| 1070 | |
| 1071 struct TypeArgumentsList extends Response { | |
| 1072 tableSize int | |
| 1073 tableUsed int | |
| 1074 typeArguments []TypeArgumentsRef | |
| 1075 } | |
| 1076 | |
| 1077 | |
| 1078 struct MetricList extends Response { | |
| 1079 metrics []Metric | |
| 1080 } | |
| 1081 | |
| 1082 | |
| 1083 struct Metric extends Response { | |
| 1084 name string | |
| 1085 description string | |
| 1086 } | |
| 1087 | |
| 1088 | |
| 1089 struct Gauge extends Metric { | |
| 1090 value float | |
| 1091 min float | |
| 1092 max float | |
| 1093 } | |
| 1094 | |
| 1095 | |
| 1096 struct Counter extends Metric { | |
| 1097 value float | |
| 1098 } | |
| 1099 | |
| 1100 | |
| 1101 // A <code>GCOption</code> is used to indicate which form of garbage | |
| 1102 // collection is requested. | |
| 1103 enum GCOption { | |
| 1104 full | |
| 1105 } | |
| 1106 | |
| 1107 // A <code>StepOption</code> is used to indicate which form of | |
| 1108 // single-stepping is requested. | |
| 1109 enum StepOption { | |
| 1110 into | |
| 1111 over | |
| 1112 out | |
| 1113 } | |
| 1114 | |
| 1115 // A <code>TagSelector</code> is used to indicate which sets of tags | |
| 1116 // should take precedence in a cpu profile. | |
| 1117 enum TagSelector { | |
| 1118 UserVM | |
| 1119 UserOnly | |
| 1120 VMUser | |
| 1121 VMOnly | |
| 1122 None | |
| 1123 } | |
| 1124 | |
| 1125 // A <code>MetricSelector</code> is used to indicate which list of metrics | |
| 1126 // should be retrieved from an isolate. | |
| 1127 enum MetricSelector { | |
| 1128 Dart | |
| 1129 Native | |
| 1130 } | |
| 1131 | |
| 1132 | |
| 1133 struct _EchoResponse extends Response { | |
| 1134 text string | |
| 1135 } | |
| 1136 | |
| 1137 | |
| 1138 struct UNDOCUMENTED { | |
| 1139 TODO int | |
| 1140 } | |
| OLD | NEW |