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 INCLUDE_DART_DEBUGGER_API_H_ | 5 #ifndef INCLUDE_DART_DEBUGGER_API_H_ |
6 #define INCLUDE_DART_DEBUGGER_API_H_ | 6 #define INCLUDE_DART_DEBUGGER_API_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 typedef struct _Dart_Breakpoint* Dart_Breakpoint; | 10 typedef struct _Dart_Breakpoint* Dart_Breakpoint; |
11 | 11 |
12 typedef struct _Dart_StackTrace* Dart_StackTrace; | 12 typedef struct _Dart_StackTrace* Dart_StackTrace; |
13 | 13 |
14 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame; | 14 typedef struct _Dart_ActivationFrame* Dart_ActivationFrame; |
15 | 15 |
16 /** | 16 /** |
17 * An id used to uniquely represent an Isolate in the debugger wire protocol | 17 * An id used to uniquely represent an Isolate in the debugger wire protocol |
18 * messages. | 18 * messages. |
19 */ | 19 */ |
20 typedef Dart_Port Dart_IsolateId; | 20 typedef Dart_Port Dart_IsolateId; |
21 | 21 |
22 /** | 22 /** |
23 * ILLEGAL_ISOLATE_ID is a number guaranteed never to be associated with a | 23 * ILLEGAL_ISOLATE_ID is a number guaranteed never to be associated with a |
24 * valid isolate. | 24 * valid isolate. |
25 */ | 25 */ |
26 #define ILLEGAL_ISOLATE_ID ILLEGAL_PORT | 26 #define ILLEGAL_ISOLATE_ID ILLEGAL_PORT |
27 | 27 |
| 28 // DEPRECATED -- use Dart_PausedEventHandler |
28 typedef void Dart_BreakpointHandler(Dart_IsolateId isolate_id, | 29 typedef void Dart_BreakpointHandler(Dart_IsolateId isolate_id, |
29 Dart_Breakpoint breakpoint, | 30 Dart_Breakpoint breakpoint, |
30 Dart_StackTrace stack_trace); | 31 Dart_StackTrace stack_trace); |
31 | 32 |
32 typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id, | 33 typedef void Dart_BreakpointResolvedHandler(Dart_IsolateId isolate_id, |
33 intptr_t bp_id, | 34 intptr_t bp_id, |
34 Dart_Handle url, | 35 Dart_Handle url, |
35 intptr_t line_number); | 36 intptr_t line_number); |
36 | 37 |
37 typedef void Dart_ExceptionThrownHandler(Dart_IsolateId isolate_id, | 38 typedef void Dart_ExceptionThrownHandler(Dart_IsolateId isolate_id, |
(...skipping 13 matching lines...) Expand all Loading... |
51 typedef struct { | 52 typedef struct { |
52 Dart_Handle script_url; // Url (string) of the script. | 53 Dart_Handle script_url; // Url (string) of the script. |
53 int32_t library_id; // Library in which the script is loaded. | 54 int32_t library_id; // Library in which the script is loaded. |
54 int32_t token_pos; // Code address. | 55 int32_t token_pos; // Code address. |
55 } Dart_CodeLocation; | 56 } Dart_CodeLocation; |
56 | 57 |
57 | 58 |
58 typedef void Dart_IsolateEventHandler(Dart_IsolateId isolate_id, | 59 typedef void Dart_IsolateEventHandler(Dart_IsolateId isolate_id, |
59 Dart_IsolateEvent kind); | 60 Dart_IsolateEvent kind); |
60 | 61 |
| 62 typedef void Dart_PausedEventHandler(Dart_IsolateId isolate_id, |
| 63 const Dart_CodeLocation& location); |
| 64 |
| 65 |
61 /** | 66 /** |
62 * Caches a given \object and returns an object id. The object id is only | 67 * Caches a given \object and returns an object id. The object id is only |
63 * valid while the VM is paused. The cache is invalidated when the VM | 68 * valid while the VM is paused. The cache is invalidated when the VM |
64 * resumes. | 69 * resumes. |
65 * | 70 * |
66 * Requires there to be a current isolate. | 71 * Requires there to be a current isolate. |
67 * | 72 * |
68 * Returns an id >= 0 on success, or -1 if there is an error. | 73 * Returns an id >= 0 on success, or -1 if there is an error. |
69 */ | 74 */ |
70 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in); | 75 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 /** | 274 /** |
270 * Can be called from the breakpoint handler. Causes the debugger to | 275 * Can be called from the breakpoint handler. Causes the debugger to |
271 * break after returning from the current Dart function. | 276 * break after returning from the current Dart function. |
272 * | 277 * |
273 * Requires there to be a current isolate. | 278 * Requires there to be a current isolate. |
274 */ | 279 */ |
275 DART_EXPORT Dart_Handle Dart_SetStepOut(); | 280 DART_EXPORT Dart_Handle Dart_SetStepOut(); |
276 | 281 |
277 | 282 |
278 /** | 283 /** |
| 284 * DEPRECATED -- use Dart_SetPausedEventHandler |
| 285 * |
279 * Installs a handler callback function that gets called by the VM | 286 * Installs a handler callback function that gets called by the VM |
280 * when a breakpoint has been reached. | 287 * when a breakpoint has been reached. |
281 * | 288 * |
282 * Requires there to be a current isolate. | 289 * Requires there to be a current isolate. |
283 */ | 290 */ |
284 DART_EXPORT void Dart_SetBreakpointHandler( | 291 DART_EXPORT void Dart_SetBreakpointHandler( |
285 Dart_BreakpointHandler bp_handler); | 292 Dart_BreakpointHandler bp_handler); |
286 | 293 |
| 294 |
| 295 /** |
| 296 * Installs a handler callback function that gets called by the VM |
| 297 * when a breakpoint location has been reached or when stepping. |
| 298 * |
| 299 * Requires there to be a current isolate. |
| 300 */ |
| 301 DART_EXPORT void Dart_SetPausedEventHandler( |
| 302 Dart_PausedEventHandler handler); |
| 303 |
| 304 |
287 /** | 305 /** |
288 * Installs a callback function that gets called by the VM when | 306 * Installs a callback function that gets called by the VM when |
289 * a breakpoint has been resolved to an actual url and line number. | 307 * a breakpoint has been resolved to an actual url and line number. |
290 * | 308 * |
291 * Requires there to be a current isolate. | 309 * Requires there to be a current isolate. |
292 */ | 310 */ |
293 DART_EXPORT void Dart_SetBreakpointResolvedHandler( | 311 DART_EXPORT void Dart_SetBreakpointResolvedHandler( |
294 Dart_BreakpointResolvedHandler handler); | 312 Dart_BreakpointResolvedHandler handler); |
295 | 313 |
296 /** | 314 /** |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 * \param request A REST-like string, which uses '/' to separate | 624 * \param request A REST-like string, which uses '/' to separate |
607 * parameters. The first parameter is always the status type. | 625 * parameters. The first parameter is always the status type. |
608 * | 626 * |
609 * \return The requested status as a JSON formatted string, with the | 627 * \return The requested status as a JSON formatted string, with the |
610 * contents defined by the status plug-in. The caller is responsible | 628 * contents defined by the status plug-in. The caller is responsible |
611 * for freeing this string. | 629 * for freeing this string. |
612 */ | 630 */ |
613 DART_EXPORT char* Dart_GetVmStatus(const char* request); | 631 DART_EXPORT char* Dart_GetVmStatus(const char* request); |
614 | 632 |
615 #endif // INCLUDE_DART_DEBUGGER_API_H_ | 633 #endif // INCLUDE_DART_DEBUGGER_API_H_ |
OLD | NEW |