OLD | NEW |
1 // | 1 // |
2 // TODO(turnidge): Finish writing an idl description of the service protocol. | 2 // TODO(turnidge): Finish writing an idl description of the service protocol. |
3 // | 3 // |
4 | 4 |
5 interface Service { | 5 interface Service { |
| 6 // Returns global information about the Dart VM. |
6 getVM() VM | 7 getVM() VM |
7 | 8 |
| 9 // Changes the debugging name for some isolate. |
| 10 setName(isolateId string, name string) Response |
| 11 |
| 12 // Returns information about an isolate. |
| 13 getIsolate(isolateId string) Isolate |
| 14 |
| 15 // Returns a list of vm flags and their values. |
8 getFlagList() FlagList | 16 getFlagList() FlagList |
9 | 17 |
| 18 // Sets the value of a vm flag |
10 setFlag(name string, value string) Response | 19 setFlag(name string, value string) Response |
11 | 20 |
| 21 // Loads an object by id from an isolate. |
12 getObject(isolateId string, objectId string) Object | 22 getObject(isolateId string, objectId string) Object |
13 | 23 |
14 // The response is a subtype of Object or ObjectRef. | 24 // The response is a subtype of Object or ObjectRef. |
15 getObjectByAddress(address string, ref bool) Response | 25 getObjectByAddress(address string, ref bool) Response |
16 | 26 |
17 // Adds a breakpoint at the specified line. | 27 // Adds a breakpoint at the specified line. |
18 // | 28 // |
19 // TODO(turnidge): Make line an int instead of a string. | 29 // TODO(turnidge): Make line an int instead of a string. |
20 addBreakpoint(isolateId string, | 30 addBreakpoint(isolateId string, |
21 scriptId string, | 31 scriptId string, |
(...skipping 19 matching lines...) Expand all Loading... |
41 eval(isolateId string, targetId string, expression string) InstanceRef | 51 eval(isolateId string, targetId string, expression string) InstanceRef |
42 | 52 |
43 // Returns the current execution stack for an isolate. | 53 // Returns the current execution stack for an isolate. |
44 getStack(isolateId string) Stack | 54 getStack(isolateId string) Stack |
45 | 55 |
46 // Returns code coverage information for a library, script, class, | 56 // Returns code coverage information for a library, script, class, |
47 // or function. | 57 // or function. |
48 getCoverage(isolateId string, targetId string) CodeCoverage | 58 getCoverage(isolateId string, targetId string) CodeCoverage |
49 | 59 |
50 // Returns call site cache information for a function. | 60 // Returns call site cache information for a function. |
51 getCallSiteData(isolateId string, targetId string) _CallSiteData | 61 _getCallSiteData(isolateId string, targetId string) _CallSiteData |
52 | 62 |
53 // Returns a full cpu profile for an isolate. | 63 // Returns a full cpu profile for an isolate. |
54 // | 64 // |
55 // <code>tagSelector</code> is optional with default 'UserVM'. | 65 // <code>tagSelector</code> is optional with default 'UserVM'. |
56 getCpuProfile(isolateId string, tags TagSelector) CpuProfile | 66 getCpuProfile(isolateId string, tags TagSelector) CpuProfile |
57 | 67 |
58 | 68 |
59 // Returns a simple tag-based profile for an isolate. | 69 // Returns a simple tag-based profile for an isolate. |
60 getTagProfile(isolateId string) TagProfile | 70 getTagProfile(isolateId string) TagProfile |
61 | 71 |
(...skipping 28 matching lines...) Expand all Loading... |
90 limit int) InboundReferences | 100 limit int) InboundReferences |
91 | 101 |
92 getClassList(isolateId string) ClassList | 102 getClassList(isolateId string) ClassList |
93 | 103 |
94 // When <code>onlyWithInstantiations</code> is true, the list only includes | 104 // When <code>onlyWithInstantiations</code> is true, the list only includes |
95 // type arguments with instantiations. Otherwise, all type arguments are | 105 // type arguments with instantiations. Otherwise, all type arguments are |
96 // returned. | 106 // returned. |
97 getTypeArgumentsList(isolateId string, | 107 getTypeArgumentsList(isolateId string, |
98 onlyWithInstantiations bool) TypeArgumentsList | 108 onlyWithInstantiations bool) TypeArgumentsList |
99 | 109 |
| 110 // Gets a list of isolate metrics. |
100 getIsolateMetricList(isolateId string, | 111 getIsolateMetricList(isolateId string, |
101 type MetricSelector) MetricList | 112 type MetricSelector) MetricList |
102 | 113 |
| 114 // Gets a specific isolate metric by id. |
103 getIsolateMetric(isolateId string, | 115 getIsolateMetric(isolateId string, |
104 metricId string) Metric | 116 metricId string) Metric |
105 | 117 |
| 118 // Gets a list of vm metrics. |
106 getVMMetricList() MetricList | 119 getVMMetricList() MetricList |
107 | 120 |
| 121 // Gets a specific vm metric by id. |
108 getVMMetric(metricId string) Metric | 122 getVMMetric(metricId string) Metric |
109 | 123 |
| 124 // A test rpc for vm requests. |
| 125 _echoVM(text string) _EchoResponse |
| 126 |
| 127 // A test rpc for isolate requests. |
110 _echo(isolateId string, | 128 _echo(isolateId string, |
111 text string) _EchoResponse | 129 text string) _EchoResponse |
112 | 130 |
113 _echoVM(text string) _EchoResponse | |
114 | |
115 // Triggers a ServiceEvent with EventType '_Echo'. | 131 // Triggers a ServiceEvent with EventType '_Echo'. |
116 _triggerEchoEvent(isolateId string, | 132 _triggerEchoEvent(isolateId string, |
117 text string) _EchoResponse | 133 text string) _EchoResponse |
118 | 134 |
119 // Response is bad JSON. | 135 // Response is bad JSON. |
120 _respondWithMalformedJson(isolateId string) Response | 136 _respondWithMalformedJson(isolateId string) Response |
121 | 137 |
122 // Response is not an object. | 138 // Response is not an object. |
123 _respondWithMalformedObject(isolateId string) Response | 139 _respondWithMalformedObject(isolateId string) Response |
124 } | 140 } |
(...skipping 10 matching lines...) Expand all Loading... |
135 type string | 151 type string |
136 | 152 |
137 // Some responses will have the <code>_vmType</code> property. This | 153 // Some responses will have the <code>_vmType</code> property. This |
138 // provides the VM-internal type name of an object, and is provided | 154 // provides the VM-internal type name of an object, and is provided |
139 // only when this type name differs from the <code>type</code> | 155 // only when this type name differs from the <code>type</code> |
140 // property. | 156 // property. |
141 _vmType string [optional] | 157 _vmType string [optional] |
142 } | 158 } |
143 | 159 |
144 | 160 |
| 161 // An asynchronous notification from the VM Service. |
| 162 struct ServiceEvent extends Response { |
| 163 // What kind of event is this? |
| 164 eventType ServiceEventType |
| 165 |
| 166 // The isolate with which this event is associated. |
| 167 isolate IsolateRef |
| 168 |
| 169 // The breakpoint associated with this event, if applicable. |
| 170 // |
| 171 // This is provided for the events: |
| 172 // <code>PauseBreakpoint</code> |
| 173 // <code>BreakpointAdded</code> |
| 174 // <code>BreakpointRemoved</code> |
| 175 // <code>BreakpointResolved</code> |
| 176 breakpoint Breakpoint [optional] |
| 177 |
| 178 // The top stack frame associated with this event, if applicable. |
| 179 // |
| 180 // This is provided for the events: |
| 181 // <code>PauseBreakpoint</code> |
| 182 // <code>PauseInterrupted</code> |
| 183 // <code>PauseException</code> |
| 184 // |
| 185 // For the <code>Resume</code> event, the top frame is provided at |
| 186 // all times except for the initial resume event that is delivered |
| 187 // when an isolate begins execution. |
| 188 topFrame Frame [optional] |
| 189 |
| 190 // The exception associated with this event, if this is a |
| 191 // <code>PauseException</code> event. |
| 192 exception InstanceRef [optional] |
| 193 } |
| 194 |
| 195 |
| 196 // The type of a service event. |
| 197 enum ServiceEventType { |
| 198 // Notification that a new isolate has started. |
| 199 IsolateStart |
| 200 |
| 201 // Notification that an isolate has exited. |
| 202 IsolateExit |
| 203 |
| 204 // Notification that isolate identifying information has changed. |
| 205 // Currently used to notify of changes to the isolate debugging name |
| 206 // via <code>setName</code>. |
| 207 IsolateUpdate |
| 208 |
| 209 // An isolate has paused at start, before executing code. |
| 210 PauseStart |
| 211 |
| 212 // An isolate has paused at exit, before terminating. |
| 213 PauseExit |
| 214 |
| 215 // An isolate has paused at a breakpoint or due to stepping. |
| 216 PauseBreakpoint |
| 217 |
| 218 // An isolate has paused due to interruption via <code>pause</code>. |
| 219 PauseInterrupted |
| 220 |
| 221 // An isolate has paused due to an exception. |
| 222 // |
| 223 // TODO(turnidge): Allow user to toggle pause-on-exceptions. |
| 224 PauseException |
| 225 |
| 226 // An isolate has started or resumed execution. |
| 227 Resume |
| 228 |
| 229 // A breakpoint has been added for an isolate. |
| 230 BreakpointAdded |
| 231 |
| 232 // An unresolved breakpoint has been resolved for an isolate. |
| 233 BreakpointResolved |
| 234 |
| 235 // A breakpoint has been removed. |
| 236 BreakpointRemoved |
| 237 |
| 238 // A garbage collection event. |
| 239 GC |
| 240 |
| 241 // The object graph is being delivered. This is triggered via |
| 242 // <code>requestHeapSnapshot</code>. |
| 243 _Graph |
| 244 } |
| 245 |
| 246 |
145 struct VM extends Response { | 247 struct VM extends Response { |
146 placeholder int | 248 // Word length on target architecture (e.g. 32, 64). |
147 } | 249 architectureBits int |
148 | 250 |
149 | 251 // The CPU we are generating code for. |
| 252 targetCPU string |
| 253 |
| 254 // The CPU we are actually running on. |
| 255 hostCPU string |
| 256 |
| 257 // The Dart VM version string. |
| 258 version string |
| 259 |
| 260 // The process id for the VM. |
| 261 pid string |
| 262 |
| 263 // The time that the VM started in milliseconds since the epoch. |
| 264 // |
| 265 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. |
| 266 startTime int |
| 267 |
| 268 // A list of isolates running in the VM. |
| 269 isolates []IsolateRef |
| 270 |
| 271 // Are assertions enabled in the VM? |
| 272 // |
| 273 // TODO(turnidge): Move to some sort of general settings list? |
| 274 _assertsEnabled bool |
| 275 |
| 276 // Are type checks enabled in the VM? |
| 277 // |
| 278 // TODO(turnidge): Move to some sort of general settings list? |
| 279 _typeChecksEnabled bool |
| 280 } |
| 281 |
| 282 |
| 283 // A reference to an an isolate. |
| 284 struct IsolateRef extends Object { |
| 285 // A numeric id for this isolate, represented as a string. Unique. |
| 286 number string |
| 287 |
| 288 // A name identifying this isolate. Not guaranteed to be unique. |
| 289 name string |
| 290 } |
| 291 |
| 292 |
| 293 // An isolate running in the VM. |
| 294 struct Isolate { |
| 295 // A numeric id for this isolate, represented as a string. Unique. |
| 296 number string |
| 297 |
| 298 // A name identifying this isolate. Not guaranteed to be unique. |
| 299 name string |
| 300 |
| 301 // The time that the VM started in milliseconds since the epoch. |
| 302 // |
| 303 // Suitable to pass to DateTime.fromMillisecondsSinceEpoch. |
| 304 startTime int |
| 305 |
| 306 // The entry function for this isolate. |
| 307 entry FunctionRef [optional] |
| 308 |
| 309 // The number of live ports for this isolate. |
| 310 livePorts int |
| 311 |
| 312 // Will this isolate pause when exiting? |
| 313 pauseOnExit bool |
| 314 |
| 315 // The last pause event delivered to the isolate. If the isolate is |
| 316 // running, this will be a resume event. |
| 317 pauseEvent ServiceEvent |
| 318 |
| 319 // The error that is causing this isolate to exit, if applicable. |
| 320 error Error [optional] |
| 321 |
| 322 // The root library for this isolate. |
| 323 rootLib LibraryRef |
| 324 |
| 325 // A list of all libraries for this isolate. |
| 326 libraries []LibraryRef |
| 327 |
| 328 // A list of all breakpoints for this isolate. |
| 329 breakpoints []Breakpoint |
| 330 |
| 331 // A list of features enabled for this isolate. |
| 332 features []string |
| 333 |
| 334 // TODO |
| 335 heaps int |
| 336 |
| 337 // TODO |
| 338 tagCounters int |
| 339 } |
| 340 |
| 341 |
| 342 // A list of flags. |
150 struct FlagList extends Response { | 343 struct FlagList extends Response { |
151 placeholder int | 344 // A list of all flags which are set to default values. |
152 } | 345 unmodifiedFlags []Flag |
153 | 346 |
154 | 347 // A list of all flags which have been modified by the user. |
155 struct _EchoResponse extends Response { | 348 modifiedFlags []Flag |
156 text string | 349 } |
157 } | 350 |
158 | 351 |
159 | 352 // A single flag. |
160 // Persistent objects in the vm are returned as subclasses of Object. | 353 struct Flag { |
| 354 // The name of the flag. |
| 355 name string |
| 356 |
| 357 // A description of the flag. |
| 358 comment string |
| 359 |
| 360 // The type of the flag. |
| 361 flagType FlagType |
| 362 } |
| 363 |
| 364 |
| 365 // The type of a flag. |
| 366 enum FlagType { |
| 367 bool |
| 368 int |
| 369 uint64_t |
| 370 string |
| 371 } |
| 372 |
| 373 |
| 374 // A reference to a persistent object that lives in some isolate. |
| 375 struct ObjectRef extends Response { |
| 376 // A unique identifier for an object. Passed to |
| 377 // <code>getObject</code> to load the full object. |
| 378 id string |
| 379 } |
| 380 |
| 381 |
| 382 // A persistent object that lives in some isolate. |
161 struct Object extends Response { | 383 struct Object extends Response { |
162 // The object <code>id</code> can be used to refer to a persistent | 384 // A unique identifier for this object. |
163 // object inside the vm or an isolate. | 385 id string |
164 id string | 386 } |
| 387 |
| 388 |
| 389 // TODO(turnidge): null type |
| 390 // TODO(turnidge): VMObject. |
| 391 |
| 392 |
| 393 // A reference to a Dart language class. |
| 394 struct ClassRef extends ObjectRef { |
| 395 // The name of this class. |
| 396 name string |
| 397 |
| 398 // A vm internal name, provided only when it is different than name. |
| 399 _vmName string |
| 400 } |
| 401 |
| 402 |
| 403 // A Dart language class. |
| 404 struct Class extends Object { |
| 405 // The name of this class. |
| 406 name string |
| 407 |
| 408 // A vm internal name, provided only when it is different than name. |
| 409 _vmName string |
| 410 |
| 411 // The error which occurred during class finalization, if it exists. |
| 412 error InstanceRef [optional] |
| 413 |
| 414 // Is this an abstract class? |
| 415 abstract bool |
| 416 |
| 417 // Is this a const class? |
| 418 const bool |
| 419 |
| 420 // Has this class been finalized? |
| 421 finalized bool |
| 422 |
| 423 // Is this class implemented? |
| 424 implemented bool |
| 425 |
| 426 // Is this a vm patch class? |
| 427 patch bool |
| 428 |
| 429 // The library which contains this class. |
| 430 library LibraryRef |
| 431 |
| 432 // The script which defines this class. May be missing for some |
| 433 // classes. |
| 434 script ScriptRef |
| 435 |
| 436 // The superclass of this class, if any. |
| 437 super ClassRef [optional] |
| 438 |
| 439 // A list of interface types for this class. |
| 440 interfaces []TypeRef |
| 441 |
| 442 // A list of fields in this class. Does not include fields from |
| 443 // superclasses. |
| 444 fields []FieldRef |
| 445 |
| 446 // A list of functions in this class. Does not include functions |
| 447 // from superclasses. |
| 448 functions []FunctionRef |
| 449 |
| 450 // A list of subclasses of this class. |
| 451 subclasses []ClassRef |
| 452 |
| 453 // Allocation statistics for this class, if available. |
| 454 allocationStats ClassHeapStats [optional] |
| 455 } |
| 456 |
| 457 |
| 458 struct ClassHeapStats extends Response { |
| 459 TODO int |
| 460 } |
| 461 |
| 462 |
| 463 // A reference to a type arguments vector. |
| 464 struct TypeArgumentsRef extends ObjectRef { |
| 465 // A name for this type argument list. |
| 466 name string |
| 467 |
| 468 // A vm internal name, provided only when it is different than name. |
| 469 _vmName string |
| 470 } |
| 471 |
| 472 |
| 473 // The type argument vector for some instantiated generic type. |
| 474 struct TypeArguments extends Object { |
| 475 // A name for this type argument list. |
| 476 name string |
| 477 |
| 478 // A vm internal name, provided only when it is different than name. |
| 479 _vmName string |
| 480 |
| 481 // A list of types. |
| 482 types []TypeRef |
| 483 } |
| 484 |
| 485 |
| 486 // Represents an error object inside the VM. |
| 487 struct Error extends Object { |
| 488 // An error message |
| 489 message string |
| 490 } |
| 491 |
| 492 |
| 493 // A <code>InstanceRef</code> encodes a reference to a |
| 494 // <code>Instance</code> object. |
| 495 struct InstanceRef extends ObjectRef { |
| 496 TODO int |
| 497 } |
| 498 |
| 499 |
| 500 struct TypeRef extends InstanceRef { |
| 501 TODO2 int |
165 } | 502 } |
166 | 503 |
167 | 504 |
168 // An <code>Instance</code> represents a Dart-language object. | 505 // An <code>Instance</code> represents a Dart-language object. |
169 struct Instance extends Object { | 506 struct Instance extends Object { |
170 placeholder int | 507 TODO int |
171 } | 508 } |
172 | 509 |
173 | 510 |
174 // A <code>Breakpoint</code> describes a debugger breakpoint. | 511 // A <code>Breakpoint</code> describes a debugger breakpoint. |
175 struct Breakpoint extends Object { | 512 struct Breakpoint extends Object { |
176 breakpointNumber int | 513 breakpointNumber int |
177 resolved bool | 514 resolved bool |
178 location Location | 515 location Location |
179 } | 516 } |
180 | 517 |
181 | 518 |
182 // References to persistent objects in the vm are returned as | |
183 // subclasses of ObjectRef. | |
184 struct ObjectRef extends Response { | |
185 // The object <code>id</code> can be used to refer to a persistent | |
186 // object inside the vm or an isolate. | |
187 id string | |
188 } | |
189 | |
190 | |
191 // A <code>CodeRef</code> encodes a reference to a <code>Code</code> object. | 519 // A <code>CodeRef</code> encodes a reference to a <code>Code</code> object. |
192 struct CodeRef extends ObjectRef { | 520 struct CodeRef extends ObjectRef { |
193 placeholder int | 521 TODO int |
194 } | 522 } |
195 | 523 |
196 | 524 |
197 struct ClassRef extends ObjectRef { | 525 struct LibraryRef extends ObjectRef { |
198 placeholder int | 526 TODO int |
199 } | |
200 | |
201 | |
202 struct TypeArgumentsRef extends ObjectRef { | |
203 placeholder int | |
204 } | 527 } |
205 | 528 |
206 | 529 |
207 // A <code>FunctionRef</code> encodes a reference to a <code>Function</code> obj
ect. | 530 // A <code>FunctionRef</code> encodes a reference to a <code>Function</code> obj
ect. |
208 struct FunctionRef extends ObjectRef { | 531 struct FunctionRef extends ObjectRef { |
209 placeholder int | 532 TODO int |
210 } | 533 } |
211 | 534 |
212 | 535 |
213 // A <code>FieldRef</code> encodes a reference to a <code>Field</code> object. | 536 // A <code>FieldRef</code> encodes a reference to a <code>Field</code> object. |
214 struct FieldRef extends ObjectRef { | 537 struct FieldRef extends ObjectRef { |
215 placeholder int | 538 TODO int |
216 } | |
217 | |
218 | |
219 // A <code>InstanceRef</code> encodes a reference to a <code>Instance</code> obj
ect. | |
220 struct InstanceRef extends ObjectRef { | |
221 placeholder int | |
222 } | 539 } |
223 | 540 |
224 | 541 |
225 // A <code>ScriptRef</code> encodes a reference to a <code>Script</code> object. | 542 // A <code>ScriptRef</code> encodes a reference to a <code>Script</code> object. |
226 struct ScriptRef extends ObjectRef { | 543 struct ScriptRef extends ObjectRef { |
227 placeholder int | 544 TODO int |
228 } | 545 } |
229 | 546 |
230 | 547 |
231 struct Class extends Object { | |
232 placeholder int | |
233 } | |
234 | |
235 | |
236 struct TypeArguments extends Object { | |
237 placeholder int | |
238 } | |
239 | |
240 | |
241 // A <code>Location</code> encodes a location withing a dart script. | 548 // A <code>Location</code> encodes a location withing a dart script. |
242 // | 549 // |
243 // TODO(turnidge): Should this really be broken out as its own type? | 550 // TODO(turnidge): Should this really be broken out as its own type? |
244 // If so, we should use it more consistently in the api. For example, | 551 // If so, we should use it more consistently in the api. For example, |
245 // in Frame. | 552 // in Frame. |
246 struct Location { | 553 struct Location { |
247 script ScriptRef | 554 script ScriptRef |
248 tokenPos int | 555 tokenPos int |
249 } | 556 } |
250 | 557 |
(...skipping 15 matching lines...) Expand all Loading... |
266 } | 573 } |
267 | 574 |
268 | 575 |
269 // A <code>Stack</code> represents an isolate's execution stack. | 576 // A <code>Stack</code> represents an isolate's execution stack. |
270 struct Stack extends Response { | 577 struct Stack extends Response { |
271 frames []Frame | 578 frames []Frame |
272 } | 579 } |
273 | 580 |
274 | 581 |
275 struct CodeCoverage extends Response { | 582 struct CodeCoverage extends Response { |
276 placeholder int | 583 TODO int |
277 } | 584 } |
278 | 585 |
279 | 586 |
280 struct _CacheEntry { | 587 struct _CacheEntry { |
281 receiverClass ClassRef | 588 receiverClass ClassRef |
282 count int | 589 count int |
283 } | 590 } |
284 | 591 |
285 | 592 |
286 struct _CallSite { | 593 struct _CallSite { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 } | 692 } |
386 | 693 |
387 | 694 |
388 struct Metric extends Response { | 695 struct Metric extends Response { |
389 name string | 696 name string |
390 description string | 697 description string |
391 } | 698 } |
392 | 699 |
393 | 700 |
394 struct Gauge extends Metric { | 701 struct Gauge extends Metric { |
395 value double | 702 value float |
396 min double | 703 min float |
397 max double | 704 max float |
398 } | 705 } |
399 | 706 |
400 | 707 |
401 struct Counter extends Metric { | 708 struct Counter extends Metric { |
402 value double | 709 value float |
403 } | 710 } |
404 | 711 |
405 | 712 |
406 // A <code>GCOption</code> is used to indicate which form of garbage | 713 // A <code>GCOption</code> is used to indicate which form of garbage |
407 // collection is requested. | 714 // collection is requested. |
408 enum GCOption { | 715 enum GCOption { |
409 full | 716 full |
410 } | 717 } |
411 | 718 |
412 // A <code>StepOption</code> is used to indicate which form of | 719 // A <code>StepOption</code> is used to indicate which form of |
(...skipping 10 matching lines...) Expand all Loading... |
423 UserVM | 730 UserVM |
424 UserOnly | 731 UserOnly |
425 VMUser | 732 VMUser |
426 VMOnly | 733 VMOnly |
427 None | 734 None |
428 } | 735 } |
429 | 736 |
430 // A <code>MetricSelector</code> is used to indicate which list of metrics | 737 // A <code>MetricSelector</code> is used to indicate which list of metrics |
431 // should be retrieved from an isolate. | 738 // should be retrieved from an isolate. |
432 enum MetricSelector { | 739 enum MetricSelector { |
433 Dart, | 740 Dart |
434 Native, | 741 Native |
435 } | 742 } |
| 743 |
| 744 |
| 745 struct _EchoResponse extends Response { |
| 746 text string |
| 747 } |
OLD | NEW |