OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_DEBUG_DEBUG_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_DEBUG_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 enum DebugBreakType { | 65 enum DebugBreakType { |
66 NOT_DEBUG_BREAK, | 66 NOT_DEBUG_BREAK, |
67 DEBUGGER_STATEMENT, | 67 DEBUGGER_STATEMENT, |
68 DEBUG_BREAK_SLOT, | 68 DEBUG_BREAK_SLOT, |
69 DEBUG_BREAK_SLOT_AT_CALL, | 69 DEBUG_BREAK_SLOT_AT_CALL, |
70 DEBUG_BREAK_SLOT_AT_RETURN, | 70 DEBUG_BREAK_SLOT_AT_RETURN, |
71 DEBUG_BREAK_SLOT_AT_TAIL_CALL, | 71 DEBUG_BREAK_SLOT_AT_TAIL_CALL, |
72 }; | 72 }; |
73 | 73 |
| 74 enum PromiseDebugActionName { |
| 75 DEBUG_NOT_ACTIVE, |
| 76 DEBUG_ASYNC_FUNCTION, |
| 77 DEBUG_PROMISE_RESOLVE, |
| 78 DEBUG_PROMISE_REJECT, |
| 79 DEBUG_PROMISE_RESOLVE_THENABLE_JOB, |
| 80 }; |
| 81 |
| 82 enum PromiseDebugActionType { |
| 83 DEBUG_ENQUEUE, |
| 84 DEBUG_ENQUEUE_RECURRING, |
| 85 DEBUG_CANCEL, |
| 86 DEBUG_WILL_HANDLE, |
| 87 DEBUG_DID_HANDLE, |
| 88 }; |
| 89 |
74 class BreakLocation { | 90 class BreakLocation { |
75 public: | 91 public: |
76 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, | 92 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, |
77 JavaScriptFrame* frame); | 93 JavaScriptFrame* frame); |
78 | 94 |
79 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 95 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
80 JavaScriptFrame* frame, | 96 JavaScriptFrame* frame, |
81 List<BreakLocation>* result_out); | 97 List<BreakLocation>* result_out); |
82 | 98 |
83 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 99 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 // DebugInfo. | 416 // DebugInfo. |
401 class Debug { | 417 class Debug { |
402 public: | 418 public: |
403 // Debug event triggers. | 419 // Debug event triggers. |
404 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 420 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
405 | 421 |
406 void OnThrow(Handle<Object> exception); | 422 void OnThrow(Handle<Object> exception); |
407 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); | 423 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); |
408 void OnCompileError(Handle<Script> script); | 424 void OnCompileError(Handle<Script> script); |
409 void OnAfterCompile(Handle<Script> script); | 425 void OnAfterCompile(Handle<Script> script); |
410 void OnAsyncTaskEvent(Handle<String> type, Handle<Object> id, | 426 void OnAsyncTaskEvent(PromiseDebugActionType type, int id, |
411 Handle<String> name); | 427 PromiseDebugActionName name); |
412 | 428 |
413 // API facing. | 429 // API facing. |
414 void SetEventListener(Handle<Object> callback, Handle<Object> data); | 430 void SetEventListener(Handle<Object> callback, Handle<Object> data); |
415 void SetMessageHandler(v8::Debug::MessageHandler handler); | 431 void SetMessageHandler(v8::Debug::MessageHandler handler); |
416 void EnqueueCommandMessage(Vector<const uint16_t> command, | 432 void EnqueueCommandMessage(Vector<const uint16_t> command, |
417 v8::Debug::ClientData* client_data = NULL); | 433 v8::Debug::ClientData* client_data = NULL); |
418 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, | 434 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, |
419 Handle<Object> data); | 435 Handle<Object> data); |
420 Handle<Context> GetDebugContext(); | 436 Handle<Context> GetDebugContext(); |
421 void HandleDebugBreak(); | 437 void HandleDebugBreak(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // Constructors for debug event objects. | 593 // Constructors for debug event objects. |
578 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 594 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
579 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( | 595 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( |
580 Handle<Object> break_points_hit); | 596 Handle<Object> break_points_hit); |
581 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 597 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
582 Handle<Object> exception, | 598 Handle<Object> exception, |
583 bool uncaught, | 599 bool uncaught, |
584 Handle<Object> promise); | 600 Handle<Object> promise); |
585 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 601 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
586 Handle<Script> script, v8::DebugEvent type); | 602 Handle<Script> script, v8::DebugEvent type); |
587 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<String> type, | 603 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<Smi> type, |
588 Handle<Object> id, | 604 Handle<Smi> id, |
589 Handle<String> name); | 605 Handle<Smi> name); |
590 | 606 |
591 // Mirror cache handling. | 607 // Mirror cache handling. |
592 void ClearMirrorCache(); | 608 void ClearMirrorCache(); |
593 | 609 |
594 void CallEventCallback(v8::DebugEvent event, | 610 void CallEventCallback(v8::DebugEvent event, |
595 Handle<Object> exec_state, | 611 Handle<Object> exec_state, |
596 Handle<Object> event_data, | 612 Handle<Object> event_data, |
597 v8::Debug::ClientData* client_data); | 613 v8::Debug::ClientData* client_data); |
598 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); | 614 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); |
599 void ProcessDebugEvent(v8::DebugEvent event, Handle<JSObject> event_data, | 615 void ProcessDebugEvent(v8::DebugEvent event, Handle<JSObject> event_data, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 Handle<Code> code); | 828 Handle<Code> code); |
813 static bool DebugBreakSlotIsPatched(Address pc); | 829 static bool DebugBreakSlotIsPatched(Address pc); |
814 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 830 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
815 }; | 831 }; |
816 | 832 |
817 | 833 |
818 } // namespace internal | 834 } // namespace internal |
819 } // namespace v8 | 835 } // namespace v8 |
820 | 836 |
821 #endif // V8_DEBUG_DEBUG_H_ | 837 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |