| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_ | 5 #ifndef RUNTIME_INCLUDE_DART_TOOLS_API_H_ |
| 6 #define RUNTIME_INCLUDE_DART_TOOLS_API_H_ | 6 #define RUNTIME_INCLUDE_DART_TOOLS_API_H_ |
| 7 | 7 |
| 8 #include "dart_api.h" | 8 #include "dart_api.h" |
| 9 | 9 |
| 10 /** \mainpage Dart Tools Embedding API Reference | 10 /** \mainpage Dart Tools Embedding API Reference |
| 11 * | 11 * |
| 12 * This reference describes the Dart embedding API for tools. Tools include | 12 * This reference describes the Dart embedding API for tools. Tools include |
| 13 * a debugger, service protocol, and timeline. | 13 * a debugger, service protocol, and timeline. |
| 14 * | 14 * |
| 15 * NOTE: The APIs described in this file are unstable and subject to change. | 15 * NOTE: The APIs described in this file are unstable and subject to change. |
| 16 * | 16 * |
| 17 * This reference is generated from the header include/dart_tools_api.h. | 17 * This reference is generated from the header include/dart_tools_api.h. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 | |
| 21 /* | 20 /* |
| 22 * ======== | 21 * ======== |
| 23 * Debugger | 22 * Debugger |
| 24 * ======== | 23 * ======== |
| 25 */ | 24 */ |
| 26 typedef struct _Dart_Breakpoint* Dart_Breakpoint; | 25 typedef struct _Dart_Breakpoint* Dart_Breakpoint; |
| 27 | 26 |
| 28 typedef struct _Dart_StackTrace* Dart_StackTrace; | 27 typedef struct _Dart_StackTrace* Dart_StackTrace; |
| 29 | 28 |
| 30 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame; | 29 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame; |
| 31 | 30 |
| 32 /** | 31 /** |
| 33 * An id used to uniquely represent an Isolate in the debugger wire protocol | 32 * An id used to uniquely represent an Isolate in the debugger wire protocol |
| 34 * messages. | 33 * messages. |
| 35 */ | 34 */ |
| 36 typedef Dart_Port Dart_IsolateId; | 35 typedef Dart_Port Dart_IsolateId; |
| 37 | 36 |
| 38 /** | 37 /** |
| 39 * ILLEGAL_ISOLATE_ID is a number guaranteed never to be associated with a | 38 * ILLEGAL_ISOLATE_ID is a number guaranteed never to be associated with a |
| 40 * valid isolate. | 39 * valid isolate. |
| 41 */ | 40 */ |
| 42 #define ILLEGAL_ISOLATE_ID ILLEGAL_PORT | 41 #define ILLEGAL_ISOLATE_ID ILLEGAL_PORT |
| 43 | 42 |
| 44 | |
| 45 /** | 43 /** |
| 46 * Null value for breakpoint id. Guaranteed never to be associated | 44 * Null value for breakpoint id. Guaranteed never to be associated |
| 47 * with a valid breakpoint. | 45 * with a valid breakpoint. |
| 48 */ | 46 */ |
| 49 #define ILLEGAL_BREAKPOINT_ID 0 | 47 #define ILLEGAL_BREAKPOINT_ID 0 |
| 50 | 48 |
| 51 | |
| 52 typedef void Dart_ExceptionThrownHandler(Dart_IsolateId isolate_id, | 49 typedef void Dart_ExceptionThrownHandler(Dart_IsolateId isolate_id, |
| 53 Dart_Handle exception_object, | 50 Dart_Handle exception_object, |
| 54 Dart_StackTrace stack_trace); | 51 Dart_StackTrace stack_trace); |
| 55 | 52 |
| 56 typedef enum { | 53 typedef enum { |
| 57 kCreated = 0, | 54 kCreated = 0, |
| 58 kInterrupted, | 55 kInterrupted, |
| 59 kShutdown, | 56 kShutdown, |
| 60 } Dart_IsolateEvent; | 57 } Dart_IsolateEvent; |
| 61 | 58 |
| 62 | |
| 63 /** | 59 /** |
| 64 * Represents a location in Dart code. | 60 * Represents a location in Dart code. |
| 65 */ | 61 */ |
| 66 typedef struct { | 62 typedef struct { |
| 67 Dart_Handle script_url; // Url (string) of the script. | 63 Dart_Handle script_url; // Url (string) of the script. |
| 68 int32_t library_id; // Library in which the script is loaded. | 64 int32_t library_id; // Library in which the script is loaded. |
| 69 int32_t token_pos; // Code address. | 65 int32_t token_pos; // Code address. |
| 70 } Dart_CodeLocation; | 66 } Dart_CodeLocation; |
| 71 | 67 |
| 72 | |
| 73 typedef void Dart_IsolateEventHandler(Dart_IsolateId isolate_id, | 68 typedef void Dart_IsolateEventHandler(Dart_IsolateId isolate_id, |
| 74 Dart_IsolateEvent kind); | 69 Dart_IsolateEvent kind); |
| 75 | 70 |
| 76 typedef void Dart_PausedEventHandler(Dart_IsolateId isolate_id, | 71 typedef void Dart_PausedEventHandler(Dart_IsolateId isolate_id, |
| 77 intptr_t bp_id, | 72 intptr_t bp_id, |
| 78 const Dart_CodeLocation& location); | 73 const Dart_CodeLocation& location); |
| 79 | 74 |
| 80 typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id, | 75 typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id, |
| 81 intptr_t bp_id, | 76 intptr_t bp_id, |
| 82 const Dart_CodeLocation& location); | 77 const Dart_CodeLocation& location); |
| 83 | 78 |
| 84 | |
| 85 /** | 79 /** |
| 86 * Caches a given \object and returns an object id. The object id is only | 80 * Caches a given \object and returns an object id. The object id is only |
| 87 * valid while the VM is paused. The cache is invalidated when the VM | 81 * valid while the VM is paused. The cache is invalidated when the VM |
| 88 * resumes. | 82 * resumes. |
| 89 * | 83 * |
| 90 * Requires there to be a current isolate. | 84 * Requires there to be a current isolate. |
| 91 * | 85 * |
| 92 * Returns an id >= 0 on success, or -1 if there is an error. | 86 * Returns an id >= 0 on success, or -1 if there is an error. |
| 93 */ | 87 */ |
| 94 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in); | 88 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in); |
| 95 | 89 |
| 96 | |
| 97 /** | 90 /** |
| 98 * Returns a cached object given the \obj_id. | 91 * Returns a cached object given the \obj_id. |
| 99 * | 92 * |
| 100 * Requires there to be a current isolate. | 93 * Requires there to be a current isolate. |
| 101 */ | 94 */ |
| 102 DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id); | 95 DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id); |
| 103 | 96 |
| 104 | |
| 105 /** | 97 /** |
| 106 * Returns a list of ids (integers) of all the libraries loaded in the | 98 * Returns a list of ids (integers) of all the libraries loaded in the |
| 107 * current isolate. | 99 * current isolate. |
| 108 * | 100 * |
| 109 * Requires there to be a current isolate. | 101 * Requires there to be a current isolate. |
| 110 * | 102 * |
| 111 * \return A handle to a list of library ids. | 103 * \return A handle to a list of library ids. |
| 112 */ | 104 */ |
| 113 DART_EXPORT Dart_Handle Dart_GetLibraryIds(); | 105 DART_EXPORT Dart_Handle Dart_GetLibraryIds(); |
| 114 | 106 |
| 115 | |
| 116 /** | 107 /** |
| 117 * Returns true if the debugger can step into code of the given library. | 108 * Returns true if the debugger can step into code of the given library. |
| 118 * | 109 * |
| 119 * Requires there to be a current isolate. | 110 * Requires there to be a current isolate. |
| 120 * | 111 * |
| 121 * \return A handle to the True object if no error occurs. | 112 * \return A handle to the True object if no error occurs. |
| 122 */ | 113 */ |
| 123 DART_EXPORT Dart_Handle Dart_GetLibraryDebuggable(intptr_t library_id, | 114 DART_EXPORT Dart_Handle Dart_GetLibraryDebuggable(intptr_t library_id, |
| 124 bool* is_debuggable); | 115 bool* is_debuggable); |
| 125 | 116 |
| 126 | |
| 127 /** | 117 /** |
| 128 * Requets that debugging be enabled for the given library. | 118 * Requets that debugging be enabled for the given library. |
| 129 * | 119 * |
| 130 * Requires there to be a current isolate. | 120 * Requires there to be a current isolate. |
| 131 * | 121 * |
| 132 * \return A handle to the True object if no error occurs. | 122 * \return A handle to the True object if no error occurs. |
| 133 */ | 123 */ |
| 134 DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id, | 124 DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id, |
| 135 bool is_debuggable); | 125 bool is_debuggable); |
| 136 | 126 |
| 137 | |
| 138 /** | 127 /** |
| 139 * Returns a list of urls (strings) of all the scripts loaded in the | 128 * Returns a list of urls (strings) of all the scripts loaded in the |
| 140 * given library. | 129 * given library. |
| 141 * | 130 * |
| 142 * Requires there to be a current isolate. | 131 * Requires there to be a current isolate. |
| 143 * | 132 * |
| 144 * \return A handle to a list of string handles. | 133 * \return A handle to a list of string handles. |
| 145 */ | 134 */ |
| 146 DART_EXPORT Dart_Handle Dart_GetScriptURLs(Dart_Handle library_url); | 135 DART_EXPORT Dart_Handle Dart_GetScriptURLs(Dart_Handle library_url); |
| 147 | 136 |
| 148 | |
| 149 /** | 137 /** |
| 150 * Returns a string containing the source code of the given script | 138 * Returns a string containing the source code of the given script |
| 151 * in the given library. | 139 * in the given library. |
| 152 * | 140 * |
| 153 * Requires there to be a current isolate. | 141 * Requires there to be a current isolate. |
| 154 * | 142 * |
| 155 * \return A handle to string containing the source text if no error | 143 * \return A handle to string containing the source text if no error |
| 156 * occurs. | 144 * occurs. |
| 157 */ | 145 */ |
| 158 DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id, | 146 DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id, |
| 159 Dart_Handle script_url_in); | 147 Dart_Handle script_url_in); |
| 160 | 148 |
| 161 | |
| 162 /** | 149 /** |
| 163 * Returns an array containing line number and token offset info | 150 * Returns an array containing line number and token offset info |
| 164 * for the given script. | 151 * for the given script. |
| 165 * | 152 * |
| 166 * Returns an array of numbers. Null values indicate the beginning of | 153 * Returns an array of numbers. Null values indicate the beginning of |
| 167 * a new line. The first number after null is the line number. | 154 * a new line. The first number after null is the line number. |
| 168 * The line number is followed by pairs of numbers, with the first value | 155 * The line number is followed by pairs of numbers, with the first value |
| 169 * being the "token offset" and the second value being the column number | 156 * being the "token offset" and the second value being the column number |
| 170 * of the token. | 157 * of the token. |
| 171 * The "token offset" is a value that is used to indicate a location | 158 * The "token offset" is a value that is used to indicate a location |
| 172 * in code, similarly to a "PC" address. | 159 * in code, similarly to a "PC" address. |
| 173 * Source lines with no tokens are omitted. | 160 * Source lines with no tokens are omitted. |
| 174 * | 161 * |
| 175 * Requires there to be a current isolate. | 162 * Requires there to be a current isolate. |
| 176 * | 163 * |
| 177 * \return A handle to an array or an error object. | 164 * \return A handle to an array or an error object. |
| 178 */ | 165 */ |
| 179 DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id, | 166 DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id, |
| 180 Dart_Handle script_url_in); | 167 Dart_Handle script_url_in); |
| 181 | 168 |
| 182 | |
| 183 /** | 169 /** |
| 184 * Returns a string containing a generated source code of the given script | 170 * Returns a string containing a generated source code of the given script |
| 185 * in the given library. This is essentially used to pretty print dart code | 171 * in the given library. This is essentially used to pretty print dart code |
| 186 * generated from any tool (e.g: dart2dart). | 172 * generated from any tool (e.g: dart2dart). |
| 187 * | 173 * |
| 188 * Requires there to be a current isolate. | 174 * Requires there to be a current isolate. |
| 189 * | 175 * |
| 190 * \return A handle to string containing the source text if no error | 176 * \return A handle to string containing the source text if no error |
| 191 * occurs. | 177 * occurs. |
| 192 */ | 178 */ |
| 193 DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in, | 179 DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in, |
| 194 Dart_Handle script_url_in); | 180 Dart_Handle script_url_in); |
| 195 | 181 |
| 196 | |
| 197 /** | 182 /** |
| 198 * Sets a breakpoint at line \line_number in \script_url, or the closest | 183 * Sets a breakpoint at line \line_number in \script_url, or the closest |
| 199 * following line (within the same function) where a breakpoint can be set. | 184 * following line (within the same function) where a breakpoint can be set. |
| 200 * | 185 * |
| 201 * Requires there to be a current isolate. | 186 * Requires there to be a current isolate. |
| 202 * | 187 * |
| 203 * \return A handle containing the breakpoint id, which is an integer | 188 * \return A handle containing the breakpoint id, which is an integer |
| 204 * value, or an error object if a breakpoint could not be set. | 189 * value, or an error object if a breakpoint could not be set. |
| 205 */ | 190 */ |
| 206 DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url, | 191 DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url, |
| 207 intptr_t line_number); | 192 intptr_t line_number); |
| 208 | 193 |
| 209 /** | 194 /** |
| 210 * Deletes the breakpoint with the given id \pb_id. | 195 * Deletes the breakpoint with the given id \pb_id. |
| 211 * | 196 * |
| 212 * Requires there to be a current isolate. | 197 * Requires there to be a current isolate. |
| 213 * | 198 * |
| 214 * \return A handle to the True object if no error occurs. | 199 * \return A handle to the True object if no error occurs. |
| 215 */ | 200 */ |
| 216 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id); | 201 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id); |
| 217 | 202 |
| 218 | |
| 219 /** | 203 /** |
| 220 * Get the script URL of the breakpoint with the given id \pb_id. | 204 * Get the script URL of the breakpoint with the given id \pb_id. |
| 221 * | 205 * |
| 222 * Requires there to be a current isolate. | 206 * Requires there to be a current isolate. |
| 223 * | 207 * |
| 224 * \return A handle to the URL (string) of the script, or an error | 208 * \return A handle to the URL (string) of the script, or an error |
| 225 * object. | 209 * object. |
| 226 */ | 210 */ |
| 227 DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id); | 211 DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id); |
| 228 | 212 |
| 229 | |
| 230 /** | 213 /** |
| 231 * Get the line number of the breakpoint with the given id \pb_id. | 214 * Get the line number of the breakpoint with the given id \pb_id. |
| 232 * | 215 * |
| 233 * Requires there to be a current isolate. | 216 * Requires there to be a current isolate. |
| 234 * | 217 * |
| 235 * \return A handle to the line number (integer) of the script, | 218 * \return A handle to the line number (integer) of the script, |
| 236 * or an error object. | 219 * or an error object. |
| 237 */ | 220 */ |
| 238 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id); | 221 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id); |
| 239 | 222 |
| 240 | |
| 241 /** | 223 /** |
| 242 * Sets a one-time breakpoint at the entry of the given function. | 224 * Sets a one-time breakpoint at the entry of the given function. |
| 243 * If class_name is the empty string, looks for a library function | 225 * If class_name is the empty string, looks for a library function |
| 244 * with the given name. | 226 * with the given name. |
| 245 * | 227 * |
| 246 * Requires there to be a current isolate. | 228 * Requires there to be a current isolate. |
| 247 * | 229 * |
| 248 * \return A handle containing the breakpoint id, which is an integer | 230 * \return A handle containing the breakpoint id, which is an integer |
| 249 * value, or an error object if a breakpoint could not be set. | 231 * value, or an error object if a breakpoint could not be set. |
| 250 */ | 232 */ |
| 251 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(Dart_Handle library, | 233 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(Dart_Handle library, |
| 252 Dart_Handle class_name, | 234 Dart_Handle class_name, |
| 253 Dart_Handle function_name); | 235 Dart_Handle function_name); |
| 254 | 236 |
| 255 | |
| 256 /** | 237 /** |
| 257 * Sets a breakpoint at the entry of the given function. If class_name | 238 * Sets a breakpoint at the entry of the given function. If class_name |
| 258 * is the empty string, looks for a library function with the given | 239 * is the empty string, looks for a library function with the given |
| 259 * name. | 240 * name. |
| 260 * | 241 * |
| 261 * Requires there to be a current isolate. | 242 * Requires there to be a current isolate. |
| 262 * | 243 * |
| 263 * \return A handle to the True object if no error occurs. | 244 * \return A handle to the True object if no error occurs. |
| 264 */ | 245 */ |
| 265 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library, | 246 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library, |
| 266 Dart_Handle class_name, | 247 Dart_Handle class_name, |
| 267 Dart_Handle function_name); | 248 Dart_Handle function_name); |
| 268 | 249 |
| 269 | |
| 270 /** | 250 /** |
| 271 * Can be called from the breakpoint handler. Sets the debugger to | 251 * Can be called from the breakpoint handler. Sets the debugger to |
| 272 * single step mode. | 252 * single step mode. |
| 273 * | 253 * |
| 274 * Requires there to be a current isolate. | 254 * Requires there to be a current isolate. |
| 275 */ | 255 */ |
| 276 DART_EXPORT Dart_Handle Dart_SetStepOver(); | 256 DART_EXPORT Dart_Handle Dart_SetStepOver(); |
| 277 | 257 |
| 278 | |
| 279 /** | 258 /** |
| 280 * Can be called from the breakpoint handler. Causes the debugger to | 259 * Can be called from the breakpoint handler. Causes the debugger to |
| 281 * break after at the beginning of the next function call. | 260 * break after at the beginning of the next function call. |
| 282 * | 261 * |
| 283 * Requires there to be a current isolate. | 262 * Requires there to be a current isolate. |
| 284 */ | 263 */ |
| 285 DART_EXPORT Dart_Handle Dart_SetStepInto(); | 264 DART_EXPORT Dart_Handle Dart_SetStepInto(); |
| 286 | 265 |
| 287 | |
| 288 /** | 266 /** |
| 289 * Can be called from the breakpoint handler. Causes the debugger to | 267 * Can be called from the breakpoint handler. Causes the debugger to |
| 290 * break after returning from the current Dart function. | 268 * break after returning from the current Dart function. |
| 291 * | 269 * |
| 292 * Requires there to be a current isolate. | 270 * Requires there to be a current isolate. |
| 293 */ | 271 */ |
| 294 DART_EXPORT Dart_Handle Dart_SetStepOut(); | 272 DART_EXPORT Dart_Handle Dart_SetStepOut(); |
| 295 | 273 |
| 296 | |
| 297 /** | 274 /** |
| 298 * Installs a handler callback function that gets called by the VM | 275 * Installs a handler callback function that gets called by the VM |
| 299 * when a breakpoint location has been reached or when stepping. | 276 * when a breakpoint location has been reached or when stepping. |
| 300 * | 277 * |
| 301 * Requires there to be a current isolate. | 278 * Requires there to be a current isolate. |
| 302 */ | 279 */ |
| 303 DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler); | 280 DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler); |
| 304 | 281 |
| 305 | |
| 306 /** | 282 /** |
| 307 * Installs a callback function that gets called by the VM when | 283 * Installs a callback function that gets called by the VM when |
| 308 * a breakpoint has been resolved to an actual url and line number. | 284 * a breakpoint has been resolved to an actual url and line number. |
| 309 * | 285 * |
| 310 * Requires there to be a current isolate. | 286 * Requires there to be a current isolate. |
| 311 */ | 287 */ |
| 312 DART_EXPORT void Dart_SetBreakpointResolvedHandler( | 288 DART_EXPORT void Dart_SetBreakpointResolvedHandler( |
| 313 Dart_BreakpointResolvedHandler handler); | 289 Dart_BreakpointResolvedHandler handler); |
| 314 | 290 |
| 315 /** | 291 /** |
| (...skipping 23 matching lines...) Expand all Loading... |
| 339 } Dart_ExceptionPauseInfo; | 315 } Dart_ExceptionPauseInfo; |
| 340 | 316 |
| 341 /** | 317 /** |
| 342 * Define on which exceptions the debugger pauses. | 318 * Define on which exceptions the debugger pauses. |
| 343 * | 319 * |
| 344 * Requires there to be a current isolate. | 320 * Requires there to be a current isolate. |
| 345 */ | 321 */ |
| 346 DART_EXPORT Dart_Handle | 322 DART_EXPORT Dart_Handle |
| 347 Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info); | 323 Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info); |
| 348 | 324 |
| 349 | |
| 350 /** | 325 /** |
| 351 * Returns on which exceptions the debugger pauses. | 326 * Returns on which exceptions the debugger pauses. |
| 352 * | 327 * |
| 353 * Requires there to be a current isolate. | 328 * Requires there to be a current isolate. |
| 354 */ | 329 */ |
| 355 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo(); | 330 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo(); |
| 356 | 331 |
| 357 /** | 332 /** |
| 358 * Returns in \trace the current stack trace, or NULL if the | 333 * Returns in \trace the current stack trace, or NULL if the |
| 359 * VM is not paused. | 334 * VM is not paused. |
| 360 * | 335 * |
| 361 * Requires there to be a current isolate. | 336 * Requires there to be a current isolate. |
| 362 * | 337 * |
| 363 * \return A valid handle if no error occurs during the operation. | 338 * \return A valid handle if no error occurs during the operation. |
| 364 */ | 339 */ |
| 365 DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace); | 340 DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace); |
| 366 | 341 |
| 367 | |
| 368 /** | 342 /** |
| 369 * Returns in \trace the stack trace associated with the error given in \handle. | 343 * Returns in \trace the stack trace associated with the error given in \handle. |
| 370 * | 344 * |
| 371 * Requires there to be a current isolate. | 345 * Requires there to be a current isolate. |
| 372 * | 346 * |
| 373 * \return A valid handle if no error occurs during the operation. | 347 * \return A valid handle if no error occurs during the operation. |
| 374 */ | 348 */ |
| 375 DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle error, | 349 DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle error, |
| 376 Dart_StackTrace* trace); | 350 Dart_StackTrace* trace); |
| 377 | 351 |
| 378 | |
| 379 /** | 352 /** |
| 380 * Returns in \length the number of activation frames in the given | 353 * Returns in \length the number of activation frames in the given |
| 381 * stack trace. | 354 * stack trace. |
| 382 * | 355 * |
| 383 * Requires there to be a current isolate. | 356 * Requires there to be a current isolate. |
| 384 * | 357 * |
| 385 * \return A handle to the True object if no error occurs. | 358 * \return A handle to the True object if no error occurs. |
| 386 */ | 359 */ |
| 387 DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace, | 360 DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace, |
| 388 intptr_t* length); | 361 intptr_t* length); |
| 389 | 362 |
| 390 | |
| 391 /** | 363 /** |
| 392 * Returns in \frame the activation frame with index \frame_index. | 364 * Returns in \frame the activation frame with index \frame_index. |
| 393 * The activation frame at the top of stack has index 0. | 365 * The activation frame at the top of stack has index 0. |
| 394 * | 366 * |
| 395 * Requires there to be a current isolate. | 367 * Requires there to be a current isolate. |
| 396 * | 368 * |
| 397 * \return A handle to the True object if no error occurs. | 369 * \return A handle to the True object if no error occurs. |
| 398 */ | 370 */ |
| 399 DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace, | 371 DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace, |
| 400 int frame_index, | 372 int frame_index, |
| 401 Dart_ActivationFrame* frame); | 373 Dart_ActivationFrame* frame); |
| 402 | 374 |
| 403 | |
| 404 /** | 375 /** |
| 405 * Returns information about the given activation frame. | 376 * Returns information about the given activation frame. |
| 406 * \function_name receives a string handle with the qualified | 377 * \function_name receives a string handle with the qualified |
| 407 * function name. | 378 * function name. |
| 408 * \script_url receives a string handle with the url of the | 379 * \script_url receives a string handle with the url of the |
| 409 * source script that contains the frame's function. | 380 * source script that contains the frame's function. |
| 410 * \line_number receives the line number in the script. | 381 * \line_number receives the line number in the script. |
| 411 * \col_number receives the column number in the script, or -1 if column | 382 * \col_number receives the column number in the script, or -1 if column |
| 412 * information is not available | 383 * information is not available |
| 413 * | 384 * |
| 414 * Any or all of the out parameters above may be NULL. | 385 * Any or all of the out parameters above may be NULL. |
| 415 * | 386 * |
| 416 * Requires there to be a current isolate. | 387 * Requires there to be a current isolate. |
| 417 * | 388 * |
| 418 * \return A valid handle if no error occurs during the operation. | 389 * \return A valid handle if no error occurs during the operation. |
| 419 */ | 390 */ |
| 420 DART_EXPORT Dart_Handle | 391 DART_EXPORT Dart_Handle |
| 421 Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame, | 392 Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame, |
| 422 Dart_Handle* function_name, | 393 Dart_Handle* function_name, |
| 423 Dart_Handle* script_url, | 394 Dart_Handle* script_url, |
| 424 intptr_t* line_number, | 395 intptr_t* line_number, |
| 425 intptr_t* column_number); | 396 intptr_t* column_number); |
| 426 | 397 |
| 427 | |
| 428 /** | 398 /** |
| 429 * Returns code location of the given activation frame. | 399 * Returns code location of the given activation frame. |
| 430 * | 400 * |
| 431 * \function_name receives a string handle with the qualified | 401 * \function_name receives a string handle with the qualified |
| 432 * function name. | 402 * function name. |
| 433 * \function receives a handle to the function. | 403 * \function receives a handle to the function. |
| 434 * \location.script_url receives a string handle with the url of | 404 * \location.script_url receives a string handle with the url of |
| 435 * the source script that contains the frame's function. | 405 * the source script that contains the frame's function. |
| 436 * Receives a null handle if there is no textual location | 406 * Receives a null handle if there is no textual location |
| 437 * that corresponds to the frame, e.g. for implicitly | 407 * that corresponds to the frame, e.g. for implicitly |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 * Requires there to be a current isolate. | 444 * Requires there to be a current isolate. |
| 475 * | 445 * |
| 476 * \return A handle to an array containing variable names and | 446 * \return A handle to an array containing variable names and |
| 477 * corresponding values. The array is empty if the activation frame has | 447 * corresponding values. The array is empty if the activation frame has |
| 478 * no variables. If non-empty, variable names are at array offsets 2*n, | 448 * no variables. If non-empty, variable names are at array offsets 2*n, |
| 479 * values at offset 2*n+1. | 449 * values at offset 2*n+1. |
| 480 */ | 450 */ |
| 481 DART_EXPORT Dart_Handle | 451 DART_EXPORT Dart_Handle |
| 482 Dart_GetLocalVariables(Dart_ActivationFrame activation_frame); | 452 Dart_GetLocalVariables(Dart_ActivationFrame activation_frame); |
| 483 | 453 |
| 484 | |
| 485 /** | 454 /** |
| 486 * Returns origin class of a function. | 455 * Returns origin class of a function. |
| 487 * | 456 * |
| 488 * Requires there to be a current isolate. | 457 * Requires there to be a current isolate. |
| 489 * | 458 * |
| 490 * \return Returns the class id (a handle to an integer) of the class in | 459 * \return Returns the class id (a handle to an integer) of the class in |
| 491 * which \function is defined. Returns a null handle if \function is defined | 460 * which \function is defined. Returns a null handle if \function is defined |
| 492 * at the top level. Returns an error object otherwise. | 461 * at the top level. Returns an error object otherwise. |
| 493 */ | 462 */ |
| 494 DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function); | 463 DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function); |
| 495 | 464 |
| 496 | |
| 497 /** | 465 /** |
| 498 * Returns an array containing all the global variable names and values of | 466 * Returns an array containing all the global variable names and values of |
| 499 * the library with given \library_id. | 467 * the library with given \library_id. |
| 500 * | 468 * |
| 501 * Requires there to be a current isolate. | 469 * Requires there to be a current isolate. |
| 502 * | 470 * |
| 503 * \return A handle to an array containing variable names and | 471 * \return A handle to an array containing variable names and |
| 504 * corresponding values. Variable names are at array offsets 2*n, | 472 * corresponding values. Variable names are at array offsets 2*n, |
| 505 * values at offset 2*n+1. | 473 * values at offset 2*n+1. |
| 506 */ | 474 */ |
| 507 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id); | 475 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id); |
| 508 | 476 |
| 509 | |
| 510 /** | 477 /** |
| 511 * Execute the expression given in string \expr in the context | 478 * Execute the expression given in string \expr in the context |
| 512 * of stack frame \activation_frame. | 479 * of stack frame \activation_frame. |
| 513 */ | 480 */ |
| 514 DART_EXPORT Dart_Handle | 481 DART_EXPORT Dart_Handle |
| 515 Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame, | 482 Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame, |
| 516 Dart_Handle expr_in); | 483 Dart_Handle expr_in); |
| 517 | 484 |
| 518 | |
| 519 /** | 485 /** |
| 520 * Execute the expression given in string \expr in the context | 486 * Execute the expression given in string \expr in the context |
| 521 * of \target. | 487 * of \target. |
| 522 * | 488 * |
| 523 * Requires there to be a current isolate. | 489 * Requires there to be a current isolate. |
| 524 * | 490 * |
| 525 * The expression is evaluated in the context of \target. | 491 * The expression is evaluated in the context of \target. |
| 526 * If \target is a Dart object, the expression is evaluated as if | 492 * If \target is a Dart object, the expression is evaluated as if |
| 527 * it were an instance method of the class of the object. | 493 * it were an instance method of the class of the object. |
| 528 * If \target is a Class, the expression is evaluated as if it | 494 * If \target is a Class, the expression is evaluated as if it |
| 529 * were a static method of that class. | 495 * were a static method of that class. |
| 530 * If \target is a Library, the expression is evaluated as if it | 496 * If \target is a Library, the expression is evaluated as if it |
| 531 * were a top-level function in that library. | 497 * were a top-level function in that library. |
| 532 * | 498 * |
| 533 * \return A handle to the computed value, or an error object if | 499 * \return A handle to the computed value, or an error object if |
| 534 * the compilation of the expression fails, or if the evaluation throws | 500 * the compilation of the expression fails, or if the evaluation throws |
| 535 * an error. | 501 * an error. |
| 536 */ | 502 */ |
| 537 DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target, Dart_Handle expr); | 503 DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target, Dart_Handle expr); |
| 538 | 504 |
| 539 | |
| 540 /** | 505 /** |
| 541 * Returns the class of the given \object. | 506 * Returns the class of the given \object. |
| 542 * | 507 * |
| 543 * Requires there to be a current isolate. | 508 * Requires there to be a current isolate. |
| 544 * | 509 * |
| 545 * \return A handle to the class object. | 510 * \return A handle to the class object. |
| 546 */ | 511 */ |
| 547 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object); | 512 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object); |
| 548 | 513 |
| 549 | |
| 550 /** | 514 /** |
| 551 * Returns in \class_id the class id of the given \object. The id is valid | 515 * Returns in \class_id the class id of the given \object. The id is valid |
| 552 * for the lifetime of the isolate. | 516 * for the lifetime of the isolate. |
| 553 * | 517 * |
| 554 * Requires there to be a current isolate. | 518 * Requires there to be a current isolate. |
| 555 * | 519 * |
| 556 * \return True if no error occurs. | 520 * \return True if no error occurs. |
| 557 */ | 521 */ |
| 558 DART_EXPORT Dart_Handle Dart_GetObjClassId(Dart_Handle object, | 522 DART_EXPORT Dart_Handle Dart_GetObjClassId(Dart_Handle object, |
| 559 intptr_t* class_id); | 523 intptr_t* class_id); |
| 560 | 524 |
| 561 | |
| 562 /** | 525 /** |
| 563 * Returns the supertype of the given instantiated type \cls. | 526 * Returns the supertype of the given instantiated type \cls. |
| 564 * | 527 * |
| 565 * Requires there to be a current isolate. | 528 * Requires there to be a current isolate. |
| 566 * | 529 * |
| 567 * \return A handle to the type object. | 530 * \return A handle to the type object. |
| 568 */ | 531 */ |
| 569 DART_EXPORT Dart_Handle Dart_GetSupertype(Dart_Handle type); | 532 DART_EXPORT Dart_Handle Dart_GetSupertype(Dart_Handle type); |
| 570 | 533 |
| 571 | |
| 572 /** | 534 /** |
| 573 * Returns handle to class with class id \class_id. | 535 * Returns handle to class with class id \class_id. |
| 574 * | 536 * |
| 575 * Requires there to be a current isolate. | 537 * Requires there to be a current isolate. |
| 576 * | 538 * |
| 577 * \return A handle to the class if no error occurs. | 539 * \return A handle to the class if no error occurs. |
| 578 */ | 540 */ |
| 579 DART_EXPORT Dart_Handle Dart_GetClassFromId(intptr_t class_id); | 541 DART_EXPORT Dart_Handle Dart_GetClassFromId(intptr_t class_id); |
| 580 | 542 |
| 581 | |
| 582 /** | 543 /** |
| 583 * Returns info about the given class \cls_id. | 544 * Returns info about the given class \cls_id. |
| 584 * | 545 * |
| 585 * \param class_name receives handle to class name (string) if non-null. | 546 * \param class_name receives handle to class name (string) if non-null. |
| 586 * \param library receives handle to library in which the class | 547 * \param library receives handle to library in which the class |
| 587 * is defined, if non-null. | 548 * is defined, if non-null. |
| 588 * \param super_class_id receives the class id to the super class of | 549 * \param super_class_id receives the class id to the super class of |
| 589 * \cls_id if non-null. | 550 * \cls_id if non-null. |
| 590 * \param static_fields If non-null, receives an array containing field | 551 * \param static_fields If non-null, receives an array containing field |
| 591 * names and values of static fields of the class. Names are | 552 * names and values of static fields of the class. Names are |
| 592 * at array offsets 2*n, values at offset 2*n+1. | 553 * at array offsets 2*n, values at offset 2*n+1. |
| 593 * | 554 * |
| 594 * Requires there to be a current isolate. | 555 * Requires there to be a current isolate. |
| 595 * | 556 * |
| 596 * \return A handle to the value true if no error occurs. | 557 * \return A handle to the value true if no error occurs. |
| 597 */ | 558 */ |
| 598 DART_EXPORT Dart_Handle Dart_GetClassInfo(intptr_t class_id, | 559 DART_EXPORT Dart_Handle Dart_GetClassInfo(intptr_t class_id, |
| 599 Dart_Handle* class_name, | 560 Dart_Handle* class_name, |
| 600 intptr_t* library_id, | 561 intptr_t* library_id, |
| 601 intptr_t* super_class_id, | 562 intptr_t* super_class_id, |
| 602 Dart_Handle* static_fields); | 563 Dart_Handle* static_fields); |
| 603 | 564 |
| 604 | |
| 605 /** Returns info about the given closure \closure. | 565 /** Returns info about the given closure \closure. |
| 606 * | 566 * |
| 607 * \param name receives handle to closure name (string). | 567 * \param name receives handle to closure name (string). |
| 608 * Receives a null handle if the closure is anonymous. | 568 * Receives a null handle if the closure is anonymous. |
| 609 * \param signature receives handle to closure signature (string). | 569 * \param signature receives handle to closure signature (string). |
| 610 * \param location.script_url receives a string handle with the url of | 570 * \param location.script_url receives a string handle with the url of |
| 611 * the source script that contains the closure. | 571 * the source script that contains the closure. |
| 612 * Receives a null handle if there is no textual location | 572 * Receives a null handle if there is no textual location |
| 613 * that corresponds to the fucntion. | 573 * that corresponds to the fucntion. |
| 614 * \param location.library_id receives the id of the library in which the | 574 * \param location.library_id receives the id of the library in which the |
| 615 * function in this frame is defined. | 575 * function in this frame is defined. |
| 616 * \param location.token_pos receives the token position in the script. | 576 * \param location.token_pos receives the token position in the script. |
| 617 * | 577 * |
| 618 * \return A handle to the value true if no error occurs. | 578 * \return A handle to the value true if no error occurs. |
| 619 */ | 579 */ |
| 620 DART_EXPORT Dart_Handle Dart_GetClosureInfo(Dart_Handle closure, | 580 DART_EXPORT Dart_Handle Dart_GetClosureInfo(Dart_Handle closure, |
| 621 Dart_Handle* name, | 581 Dart_Handle* name, |
| 622 Dart_Handle* signature, | 582 Dart_Handle* signature, |
| 623 Dart_CodeLocation* location); | 583 Dart_CodeLocation* location); |
| 624 | 584 |
| 625 | |
| 626 /** | 585 /** |
| 627 * Returns an array containing all instance field names and values of | 586 * Returns an array containing all instance field names and values of |
| 628 * the given \object. | 587 * the given \object. |
| 629 * | 588 * |
| 630 * Requires there to be a current isolate. | 589 * Requires there to be a current isolate. |
| 631 * | 590 * |
| 632 * \return A handle to an array containing field names and | 591 * \return A handle to an array containing field names and |
| 633 * corresponding field values. The array is empty if the object has | 592 * corresponding field values. The array is empty if the object has |
| 634 * no fields. If non-empty, field names are at array offsets 2*n, | 593 * no fields. If non-empty, field names are at array offsets 2*n, |
| 635 * values at offset 2*n+1. Field values may also be a handle to an | 594 * values at offset 2*n+1. Field values may also be a handle to an |
| 636 * error object if an error was encountered evaluating the field. | 595 * error object if an error was encountered evaluating the field. |
| 637 */ | 596 */ |
| 638 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object); | 597 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object); |
| 639 | 598 |
| 640 | |
| 641 /** | 599 /** |
| 642 * Returns an array containing all static field names and values of | 600 * Returns an array containing all static field names and values of |
| 643 * the given type \target. | 601 * the given type \target. |
| 644 * | 602 * |
| 645 * Requires there to be a current isolate. | 603 * Requires there to be a current isolate. |
| 646 * | 604 * |
| 647 * \return A handle to an array containing field names and | 605 * \return A handle to an array containing field names and |
| 648 * corresponding field values. The array is empty if the class has | 606 * corresponding field values. The array is empty if the class has |
| 649 * no static fields. If non-empty, field names are at array offsets 2*n, | 607 * no static fields. If non-empty, field names are at array offsets 2*n, |
| 650 * values at offset 2*n+1. Field values may also be a handle to an | 608 * values at offset 2*n+1. Field values may also be a handle to an |
| 651 * error object if an error was encountered evaluating the field. | 609 * error object if an error was encountered evaluating the field. |
| 652 */ | 610 */ |
| 653 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target); | 611 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target); |
| 654 | 612 |
| 655 | |
| 656 /** | 613 /** |
| 657 * Returns a handle to the library \library_id. | 614 * Returns a handle to the library \library_id. |
| 658 * | 615 * |
| 659 * Requires there to be a current isolate. | 616 * Requires there to be a current isolate. |
| 660 * | 617 * |
| 661 * \return A library handle if the id is valid. | 618 * \return A library handle if the id is valid. |
| 662 */ | 619 */ |
| 663 DART_EXPORT Dart_Handle Dart_GetLibraryFromId(intptr_t library_id); | 620 DART_EXPORT Dart_Handle Dart_GetLibraryFromId(intptr_t library_id); |
| 664 | 621 |
| 665 | |
| 666 /** | 622 /** |
| 667 * Returns in \library_id the library id of the given \library. | 623 * Returns in \library_id the library id of the given \library. |
| 668 * | 624 * |
| 669 * \return A valid handle if no error occurs during the operation. | 625 * \return A valid handle if no error occurs during the operation. |
| 670 */ | 626 */ |
| 671 DART_EXPORT Dart_Handle Dart_LibraryId(Dart_Handle library, | 627 DART_EXPORT Dart_Handle Dart_LibraryId(Dart_Handle library, |
| 672 intptr_t* library_id); | 628 intptr_t* library_id); |
| 673 | 629 |
| 674 | |
| 675 /** | 630 /** |
| 676 * Returns an array containing all variable names and values of | 631 * Returns an array containing all variable names and values of |
| 677 * the given library \library_id. | 632 * the given library \library_id. |
| 678 * | 633 * |
| 679 * Requires there to be a current isolate. | 634 * Requires there to be a current isolate. |
| 680 * | 635 * |
| 681 * \return A handle to an array containing variable names and | 636 * \return A handle to an array containing variable names and |
| 682 * corresponding values. The array is empty if the library has | 637 * corresponding values. The array is empty if the library has |
| 683 * no variables. If non-empty, variable names are at array offsets 2*n, | 638 * no variables. If non-empty, variable names are at array offsets 2*n, |
| 684 * values at offset 2*n+1. Variable values may also be a handle to an | 639 * values at offset 2*n+1. Variable values may also be a handle to an |
| 685 * error object if an error was encountered evaluating the value. | 640 * error object if an error was encountered evaluating the value. |
| 686 */ | 641 */ |
| 687 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id); | 642 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id); |
| 688 | 643 |
| 689 | |
| 690 /** | 644 /** |
| 691 * Returns an array containing all imported libraries of | 645 * Returns an array containing all imported libraries of |
| 692 * the given library \library_id. | 646 * the given library \library_id. |
| 693 * | 647 * |
| 694 * Requires there to be a current isolate. | 648 * Requires there to be a current isolate. |
| 695 * | 649 * |
| 696 * \return A handle to an array containing prefix names and | 650 * \return A handle to an array containing prefix names and |
| 697 * library ids. The array is empty if the library has | 651 * library ids. The array is empty if the library has |
| 698 * no imports. If non-empty, import prefixes are at array offsets 2*n, | 652 * no imports. If non-empty, import prefixes are at array offsets 2*n, |
| 699 * corresponding library ids at offset 2*n+1. Prefixes may be null | 653 * corresponding library ids at offset 2*n+1. Prefixes may be null |
| 700 * which indicates the respective library has been imported without | 654 * which indicates the respective library has been imported without |
| 701 * a prefix. | 655 * a prefix. |
| 702 */ | 656 */ |
| 703 DART_EXPORT Dart_Handle Dart_GetLibraryImports(intptr_t library_id); | 657 DART_EXPORT Dart_Handle Dart_GetLibraryImports(intptr_t library_id); |
| 704 | 658 |
| 705 | |
| 706 /** | 659 /** |
| 707 * Returns the url of the library \library_id. | 660 * Returns the url of the library \library_id. |
| 708 * | 661 * |
| 709 * Requires there to be a current isolate. | 662 * Requires there to be a current isolate. |
| 710 * | 663 * |
| 711 * \return A string handle containing the URL of the library. | 664 * \return A string handle containing the URL of the library. |
| 712 */ | 665 */ |
| 713 DART_EXPORT Dart_Handle Dart_GetLibraryURL(intptr_t library_id); | 666 DART_EXPORT Dart_Handle Dart_GetLibraryURL(intptr_t library_id); |
| 714 | 667 |
| 715 | |
| 716 /** | 668 /** |
| 717 * Returns the isolate object corresponding to the isolate id. | 669 * Returns the isolate object corresponding to the isolate id. |
| 718 * | 670 * |
| 719 * \return The Dart_Isolate object corresponding to the isolate id. | 671 * \return The Dart_Isolate object corresponding to the isolate id. |
| 720 * If the specified id is invalid NULL is returned. | 672 * If the specified id is invalid NULL is returned. |
| 721 */ | 673 */ |
| 722 DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id); | 674 DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id); |
| 723 | 675 |
| 724 | |
| 725 /** | 676 /** |
| 726 * Returns the isolate id for an isolate. | 677 * Returns the isolate id for an isolate. |
| 727 * | 678 * |
| 728 * \return The Dart_IsolateId value corresponding to the isolate. | 679 * \return The Dart_IsolateId value corresponding to the isolate. |
| 729 */ | 680 */ |
| 730 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate isolate); | 681 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate isolate); |
| 731 | 682 |
| 732 | |
| 733 /* | 683 /* |
| 734 * ======= | 684 * ======= |
| 735 * Service | 685 * Service |
| 736 * ======= | 686 * ======= |
| 737 */ | 687 */ |
| 738 | 688 |
| 739 /** | 689 /** |
| 740 * A service request callback function. | 690 * A service request callback function. |
| 741 * | 691 * |
| 742 * These callbacks, registered by the embedder, are called when the VM receives | 692 * These callbacks, registered by the embedder, are called when the VM receives |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 * \return True if the result is a regular JSON-RPC response, false if the | 724 * \return True if the result is a regular JSON-RPC response, false if the |
| 775 * result is a JSON-RPC error. | 725 * result is a JSON-RPC error. |
| 776 */ | 726 */ |
| 777 typedef bool (*Dart_ServiceRequestCallback)(const char* method, | 727 typedef bool (*Dart_ServiceRequestCallback)(const char* method, |
| 778 const char** param_keys, | 728 const char** param_keys, |
| 779 const char** param_values, | 729 const char** param_values, |
| 780 intptr_t num_params, | 730 intptr_t num_params, |
| 781 void* user_data, | 731 void* user_data, |
| 782 const char** json_object); | 732 const char** json_object); |
| 783 | 733 |
| 784 | |
| 785 /** | 734 /** |
| 786 * Register a Dart_ServiceRequestCallback to be called to handle | 735 * Register a Dart_ServiceRequestCallback to be called to handle |
| 787 * requests for the named rpc on a specific isolate. The callback will | 736 * requests for the named rpc on a specific isolate. The callback will |
| 788 * be invoked with the current isolate set to the request target. | 737 * be invoked with the current isolate set to the request target. |
| 789 * | 738 * |
| 790 * \param method The name of the method that this callback is responsible for. | 739 * \param method The name of the method that this callback is responsible for. |
| 791 * \param callback The callback to invoke. | 740 * \param callback The callback to invoke. |
| 792 * \param user_data The user data passed to the callback. | 741 * \param user_data The user data passed to the callback. |
| 793 * | 742 * |
| 794 * NOTE: If multiple callbacks with the same name are registered, only | 743 * NOTE: If multiple callbacks with the same name are registered, only |
| 795 * the last callback registered will be remembered. | 744 * the last callback registered will be remembered. |
| 796 */ | 745 */ |
| 797 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( | 746 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( |
| 798 const char* method, | 747 const char* method, |
| 799 Dart_ServiceRequestCallback callback, | 748 Dart_ServiceRequestCallback callback, |
| 800 void* user_data); | 749 void* user_data); |
| 801 | 750 |
| 802 | |
| 803 /** | 751 /** |
| 804 * Register a Dart_ServiceRequestCallback to be called to handle | 752 * Register a Dart_ServiceRequestCallback to be called to handle |
| 805 * requests for the named rpc. The callback will be invoked without a | 753 * requests for the named rpc. The callback will be invoked without a |
| 806 * current isolate. | 754 * current isolate. |
| 807 * | 755 * |
| 808 * \param method The name of the command that this callback is responsible for. | 756 * \param method The name of the command that this callback is responsible for. |
| 809 * \param callback The callback to invoke. | 757 * \param callback The callback to invoke. |
| 810 * \param user_data The user data passed to the callback. | 758 * \param user_data The user data passed to the callback. |
| 811 * | 759 * |
| 812 * NOTE: If multiple callbacks with the same name are registered, only | 760 * NOTE: If multiple callbacks with the same name are registered, only |
| 813 * the last callback registered will be remembered. | 761 * the last callback registered will be remembered. |
| 814 */ | 762 */ |
| 815 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 763 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 816 const char* method, | 764 const char* method, |
| 817 Dart_ServiceRequestCallback callback, | 765 Dart_ServiceRequestCallback callback, |
| 818 void* user_data); | 766 void* user_data); |
| 819 | 767 |
| 820 | |
| 821 /* | 768 /* |
| 822 * ======== | 769 * ======== |
| 823 * Event Streams | 770 * Event Streams |
| 824 * ======== | 771 * ======== |
| 825 */ | 772 */ |
| 826 | 773 |
| 827 /** | 774 /** |
| 828 * A callback invoked when the VM service gets a request to listen to | 775 * A callback invoked when the VM service gets a request to listen to |
| 829 * some stream. | 776 * some stream. |
| 830 * | 777 * |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 /** All timeline streams */ | 892 /** All timeline streams */ |
| 946 #define DART_TIMELINE_STREAM_ALL \ | 893 #define DART_TIMELINE_STREAM_ALL \ |
| 947 (DART_TIMELINE_STREAM_API | DART_TIMELINE_STREAM_COMPILER | \ | 894 (DART_TIMELINE_STREAM_API | DART_TIMELINE_STREAM_COMPILER | \ |
| 948 DART_TIMELINE_STREAM_DART | DART_TIMELINE_STREAM_DEBUGGER | \ | 895 DART_TIMELINE_STREAM_DART | DART_TIMELINE_STREAM_DEBUGGER | \ |
| 949 DART_TIMELINE_STREAM_EMBEDDER | DART_TIMELINE_STREAM_GC | \ | 896 DART_TIMELINE_STREAM_EMBEDDER | DART_TIMELINE_STREAM_GC | \ |
| 950 DART_TIMELINE_STREAM_ISOLATE | DART_TIMELINE_STREAM_VM) | 897 DART_TIMELINE_STREAM_ISOLATE | DART_TIMELINE_STREAM_VM) |
| 951 | 898 |
| 952 /** Disable all timeline stream recording */ | 899 /** Disable all timeline stream recording */ |
| 953 #define DART_TIMELINE_STREAM_DISABLE 0 | 900 #define DART_TIMELINE_STREAM_DISABLE 0 |
| 954 | 901 |
| 955 | |
| 956 /** | 902 /** |
| 957 * Start recording timeline events for the entire VM (including all isolates). | 903 * Start recording timeline events for the entire VM (including all isolates). |
| 958 * | 904 * |
| 959 * \param stream_mask A bitmask of streams that should be recorded. | 905 * \param stream_mask A bitmask of streams that should be recorded. |
| 960 * | 906 * |
| 961 * NOTE: Calling with 0 disables recording of all streams. | 907 * NOTE: Calling with 0 disables recording of all streams. |
| 962 */ | 908 */ |
| 963 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask); | 909 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask); |
| 964 | 910 |
| 965 | |
| 966 typedef enum { | 911 typedef enum { |
| 967 /** Indicates a new stream is being output */ | 912 /** Indicates a new stream is being output */ |
| 968 Dart_StreamConsumer_kStart = 0, | 913 Dart_StreamConsumer_kStart = 0, |
| 969 /** Data for the current stream */ | 914 /** Data for the current stream */ |
| 970 Dart_StreamConsumer_kData = 1, | 915 Dart_StreamConsumer_kData = 1, |
| 971 /** Indicates stream is finished */ | 916 /** Indicates stream is finished */ |
| 972 Dart_StreamConsumer_kFinish = 2, | 917 Dart_StreamConsumer_kFinish = 2, |
| 973 } Dart_StreamConsumer_State; | 918 } Dart_StreamConsumer_State; |
| 974 | 919 |
| 975 /** | 920 /** |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 * \param start_recording See Dart_EmbedderTimelineStartRecording. | 1017 * \param start_recording See Dart_EmbedderTimelineStartRecording. |
| 1073 * \param stop_recording See Dart_EmbedderTimelineStopRecording. | 1018 * \param stop_recording See Dart_EmbedderTimelineStopRecording. |
| 1074 * | 1019 * |
| 1075 * NOTE: To avoid races, this should be called before Dart_Initialize. | 1020 * NOTE: To avoid races, this should be called before Dart_Initialize. |
| 1076 */ | 1021 */ |
| 1077 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( | 1022 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( |
| 1078 Dart_EmbedderTimelineStartRecording start_recording, | 1023 Dart_EmbedderTimelineStartRecording start_recording, |
| 1079 Dart_EmbedderTimelineStopRecording stop_recording); | 1024 Dart_EmbedderTimelineStopRecording stop_recording); |
| 1080 | 1025 |
| 1081 #endif // RUNTIME_INCLUDE_DART_TOOLS_API_H_ | 1026 #endif // RUNTIME_INCLUDE_DART_TOOLS_API_H_ |
| OLD | NEW |