| OLD | NEW |
| (Empty) | |
| 1 // |
| 2 // TODO(turnidge): Finish writing an idl description of the service protocol. |
| 3 // |
| 4 |
| 5 interface Service { |
| 6 // Returns the list of breakpoints for an isolate. |
| 7 getBreakpoints(isolateId string) BreakpointList |
| 8 |
| 9 // Adds a breakpoint at the specified line. |
| 10 // |
| 11 // TODO(turnidge): Make line an int instead of a string. |
| 12 addBreakpoint(isolateId string, |
| 13 scriptId string, |
| 14 line string) Breakpoint |
| 15 |
| 16 // Removes the specified breakpoint |
| 17 removeBreakpoint(isolateId string, breakpointId string) Response |
| 18 |
| 19 // Requests that an isolate pause execution. |
| 20 pause(isolateId string) Response |
| 21 |
| 22 // Requests that an isolate resume execution. |
| 23 // |
| 24 // <code>step</code> is optional and indicates whether execution |
| 25 // should single-step. |
| 26 resume(isolateId string, step StepOption) Response |
| 27 |
| 28 // Evaluate an expression in the context of some target. |
| 29 eval(isolateId string, targetId string, expression string) InstanceRef |
| 30 |
| 31 // Returns the current execution stack for an isolate. |
| 32 getStack(isolateId string) Stack |
| 33 |
| 34 // Returns code coverage information for a library, script, class, |
| 35 // or function. |
| 36 getCoverage(isolateId string, targetId string) CodeCoverage |
| 37 |
| 38 // Returns a full cpu profile for an isolate. |
| 39 // |
| 40 // <code>tagSelector</code> is optional with default 'UserVM'. |
| 41 getCpuProfile(isolateId string, tags TagSelector) CpuProfile |
| 42 |
| 43 |
| 44 // Returns a simple tag-based profile for an isolate. |
| 45 getTagProfile(isolateId string) TagProfile |
| 46 |
| 47 // Returns an allocation profile for an isolate. |
| 48 // |
| 49 // <code>reset</code> is optional and indicates whether allocation |
| 50 // accumulators should be reset. |
| 51 // |
| 52 // <code>gc</code> is optional and indicates whether a full |
| 53 getAllocationProfile(isolateId string, |
| 54 reset bool, |
| 55 gc GCOption) AllocationProfile |
| 56 |
| 57 // Returns the heap map for an isolate. |
| 58 getHeapMap(isolateId string) HeapMap |
| 59 |
| 60 // Returns how many bytes are retained by some target Class or Instance. |
| 61 getRetainedSize(isolateId string, targetId string) InstanceRef |
| 62 |
| 63 // Returns a path demonstrating why an object is retained in memory. |
| 64 // |
| 65 // TODO(turnidge): Make limit an int instead of a string. |
| 66 getRetainingPath(isolateId string, |
| 67 targetId string, |
| 68 limit int) RetainingPath |
| 69 |
| 70 // Returns a collection of inbound references to some object. |
| 71 // |
| 72 // TODO(turnidge): Make limit an int instead of a string. |
| 73 getInboundReferences(isolateId string, |
| 74 targetId string, |
| 75 limit int) InboundReferences |
| 76 } |
| 77 |
| 78 |
| 79 // Every top level response returned by the Service interface extends |
| 80 // <code>Response</code>. This allows the client to distinguish |
| 81 // between different kinds of responses by using the <code>type</code> |
| 82 // property. |
| 83 struct Response { |
| 84 // Every response returned by the VM Service has the |
| 85 // <code>type</code> property. This allows the client distinguish |
| 86 // between different kinds of responses. |
| 87 type string |
| 88 |
| 89 // Some responses will have the <code>_vmType</code> property. This |
| 90 // provides the VM-internal type name of an object, and is provided |
| 91 // only when this type name differs from the <code>type</code> |
| 92 // property. |
| 93 _vmType string [optional] |
| 94 } |
| 95 |
| 96 |
| 97 // Persistent objects in the vm are returned as subclasses of Object. |
| 98 struct Object extends Response { |
| 99 // The object <code>id</code> can be used to refer to a persistent |
| 100 // object inside the vm or an isolate. |
| 101 id string |
| 102 } |
| 103 |
| 104 |
| 105 // An <code>Instance</code> represents a Dart-language object. |
| 106 struct Instance extends Object { |
| 107 placeholder int |
| 108 } |
| 109 |
| 110 |
| 111 // A <code>Breakpoint</code> describes a debugger breakpoint. |
| 112 struct Breakpoint extends Object { |
| 113 breakpointNumber int |
| 114 enabled bool |
| 115 resolved bool |
| 116 location Location |
| 117 } |
| 118 |
| 119 |
| 120 // References to persistent objects in the vm are returned as |
| 121 // subclasses of ObjectRef. |
| 122 struct ObjectRef extends Response { |
| 123 // The object <code>id</code> can be used to refer to a persistent |
| 124 // object inside the vm or an isolate. |
| 125 id string |
| 126 } |
| 127 |
| 128 |
| 129 // A <code>CodeRef</code> encodes a reference to a <code>Code</code> object. |
| 130 struct CodeRef extends ObjectRef { |
| 131 placeholder int |
| 132 } |
| 133 |
| 134 |
| 135 // A <code>FunctionRef</code> encodes a reference to a <code>Function</code> obj
ect. |
| 136 struct FunctionRef extends ObjectRef { |
| 137 placeholder int |
| 138 } |
| 139 |
| 140 |
| 141 // A <code>FieldRef</code> encodes a reference to a <code>Field</code> object. |
| 142 struct FieldRef extends ObjectRef { |
| 143 placeholder int |
| 144 } |
| 145 |
| 146 |
| 147 // A <code>InstanceRef</code> encodes a reference to a <code>Instance</code> obj
ect. |
| 148 struct InstanceRef extends ObjectRef { |
| 149 placeholder int |
| 150 } |
| 151 |
| 152 |
| 153 // A <code>ScriptRef</code> encodes a reference to a <code>Script</code> object. |
| 154 struct ScriptRef extends ObjectRef { |
| 155 placeholder int |
| 156 } |
| 157 |
| 158 |
| 159 // A <code>Location</code> encodes a location withing a dart script. |
| 160 // |
| 161 // TODO(turnidge): Should this really be broken out as its own type? |
| 162 // If so, we should use it more consistently in the api. For example, |
| 163 // in Frame. |
| 164 struct Location { |
| 165 script ScriptRef |
| 166 tokenPos int |
| 167 } |
| 168 |
| 169 |
| 170 // A <code>Variable</code> represents one name/value pair from a frame. |
| 171 struct Variable { |
| 172 name string |
| 173 value InstanceRef |
| 174 } |
| 175 |
| 176 |
| 177 // A <code>Frame</code> represents one frame from an isolate's stack. |
| 178 struct Frame { |
| 179 script ScriptRef |
| 180 tokenPos int |
| 181 function FunctionRef |
| 182 code CodeRef |
| 183 vars []Variable |
| 184 } |
| 185 |
| 186 |
| 187 // A <code>Stack</code> represents an isolate's execution stack. |
| 188 struct Stack extends Response { |
| 189 frames []Frame |
| 190 } |
| 191 |
| 192 |
| 193 struct CodeCoverage extends Response { |
| 194 placeholder int |
| 195 } |
| 196 |
| 197 // A <code>TagProfile</code> is a limited profile encoded as parallel |
| 198 // arrays of tag names and tag values. |
| 199 struct TagProfile extends Response { |
| 200 names []string |
| 201 counters []int |
| 202 } |
| 203 |
| 204 |
| 205 // A list of <code>Breakpoint</code> |
| 206 struct BreakpointList extends Response { |
| 207 breakpoints []Breakpoint |
| 208 } |
| 209 |
| 210 |
| 211 // An <code>AllocationProfile</code> encodes an allocation profile. |
| 212 struct AllocationProfile extends Response { |
| 213 todo int |
| 214 } |
| 215 |
| 216 |
| 217 // A <code>CpuProfile</code> encodes a full cpu profile. |
| 218 struct CpuProfile extends Response { |
| 219 samples int |
| 220 depth int |
| 221 period int |
| 222 timeSpan float |
| 223 exclusive_trie []int |
| 224 codes []CodeRegion |
| 225 } |
| 226 |
| 227 |
| 228 // A <code>CodeRegion</code> represents profiling information for a |
| 229 // specific <code>Code</code> object. |
| 230 struct CodeRegion { |
| 231 kind string |
| 232 inclusive_ticks int |
| 233 exclusive_ticks int |
| 234 code CodeRef |
| 235 ticks []int |
| 236 callers []int |
| 237 } |
| 238 |
| 239 // An <code>HeapMap</code> provides a memory view of all heap allocated objects. |
| 240 struct HeapMap extends Response { |
| 241 todo int |
| 242 } |
| 243 |
| 244 |
| 245 // An <code>HeapMap</code> provides a memory view of all heap allocated objects. |
| 246 struct RetainingPath extends Response { |
| 247 length int |
| 248 elements []RetainingPathElement |
| 249 } |
| 250 |
| 251 |
| 252 // One entry in a <code>RetainingPath</code>. |
| 253 struct RetainingPathElement { |
| 254 index int |
| 255 element InstanceRef |
| 256 parentListIndex int [optional] |
| 257 parentField FieldRef [optional] |
| 258 } |
| 259 |
| 260 |
| 261 struct InboundReferences extends Response { |
| 262 length int |
| 263 references []InboundReference |
| 264 } |
| 265 |
| 266 |
| 267 // TODO(koda): slot can actually be a string, and integer or a |
| 268 // FieldRef. Fix this to be consistent with RetainingPathElement. |
| 269 struct InboundReference { |
| 270 source InstanceRef |
| 271 slot int |
| 272 } |
| 273 |
| 274 |
| 275 // A <code>GCOption</code> is used to indicate which form of garbage |
| 276 // collection is requested. |
| 277 enum GCOption { |
| 278 full |
| 279 } |
| 280 |
| 281 // A <code>StepOption</code> is used to indicate which form of |
| 282 // single-stepping is requested. |
| 283 enum StepOption { |
| 284 into |
| 285 over |
| 286 out |
| 287 } |
| 288 |
| 289 // A <code>TagSelector</code> is used to indicate which sets of tags |
| 290 // should take precedence in a cpu profile. |
| 291 enum TagSelector { |
| 292 UserVM |
| 293 UserOnly |
| 294 VMUser |
| 295 VMOnly |
| 296 None |
| 297 } |
| 298 |
| OLD | NEW |