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 const int DEBUG_PROMISE_DEFAULT_ID = 0; | |
adamk
2017/01/03 18:18:17
kDebugPromiseDefaultId please. SHOUTING_CASE is on
| |
75 | |
76 enum PromiseDebugActionName { | |
77 DEBUG_NOT_ACTIVE, | |
78 DEBUG_ASYNC_FUNCTION, | |
79 DEBUG_PROMISE_RESOLVE, | |
80 DEBUG_PROMISE_REJECT, | |
81 DEBUG_PROMISE_RESOLVE_THENABLE_JOB, | |
82 }; | |
83 | |
84 enum PromiseDebugActionType { | |
85 DEBUG_ENQUEUE, | |
86 DEBUG_ENQUEUE_RECURRING, | |
87 DEBUG_CANCEL, | |
88 DEBUG_WILL_HANDLE, | |
89 DEBUG_DID_HANDLE, | |
90 }; | |
91 | |
74 class BreakLocation { | 92 class BreakLocation { |
75 public: | 93 public: |
76 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, | 94 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, |
77 JavaScriptFrame* frame); | 95 JavaScriptFrame* frame); |
78 | 96 |
79 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 97 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
80 JavaScriptFrame* frame, | 98 JavaScriptFrame* frame, |
81 List<BreakLocation>* result_out); | 99 List<BreakLocation>* result_out); |
82 | 100 |
83 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 101 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. | 418 // DebugInfo. |
401 class Debug { | 419 class Debug { |
402 public: | 420 public: |
403 // Debug event triggers. | 421 // Debug event triggers. |
404 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 422 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
405 | 423 |
406 void OnThrow(Handle<Object> exception); | 424 void OnThrow(Handle<Object> exception); |
407 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); | 425 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); |
408 void OnCompileError(Handle<Script> script); | 426 void OnCompileError(Handle<Script> script); |
409 void OnAfterCompile(Handle<Script> script); | 427 void OnAfterCompile(Handle<Script> script); |
410 void OnAsyncTaskEvent(Handle<String> type, Handle<Object> id, | 428 void OnAsyncTaskEvent(PromiseDebugActionType type, int id, |
411 Handle<String> name); | 429 PromiseDebugActionName name); |
412 | 430 |
413 // API facing. | 431 // API facing. |
414 void SetEventListener(Handle<Object> callback, Handle<Object> data); | 432 void SetEventListener(Handle<Object> callback, Handle<Object> data); |
415 void SetMessageHandler(v8::Debug::MessageHandler handler); | 433 void SetMessageHandler(v8::Debug::MessageHandler handler); |
416 void EnqueueCommandMessage(Vector<const uint16_t> command, | 434 void EnqueueCommandMessage(Vector<const uint16_t> command, |
417 v8::Debug::ClientData* client_data = NULL); | 435 v8::Debug::ClientData* client_data = NULL); |
418 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, | 436 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, |
419 Handle<Object> data); | 437 Handle<Object> data); |
420 Handle<Context> GetDebugContext(); | 438 Handle<Context> GetDebugContext(); |
421 void HandleDebugBreak(); | 439 void HandleDebugBreak(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 // Constructors for debug event objects. | 595 // Constructors for debug event objects. |
578 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 596 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
579 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( | 597 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( |
580 Handle<Object> break_points_hit); | 598 Handle<Object> break_points_hit); |
581 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 599 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
582 Handle<Object> exception, | 600 Handle<Object> exception, |
583 bool uncaught, | 601 bool uncaught, |
584 Handle<Object> promise); | 602 Handle<Object> promise); |
585 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 603 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
586 Handle<Script> script, v8::DebugEvent type); | 604 Handle<Script> script, v8::DebugEvent type); |
587 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<String> type, | 605 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<Smi> type, |
588 Handle<Object> id, | 606 Handle<Smi> id, |
589 Handle<String> name); | 607 Handle<Smi> name); |
590 | 608 |
591 // Mirror cache handling. | 609 // Mirror cache handling. |
592 void ClearMirrorCache(); | 610 void ClearMirrorCache(); |
593 | 611 |
594 void CallEventCallback(v8::DebugEvent event, | 612 void CallEventCallback(v8::DebugEvent event, |
595 Handle<Object> exec_state, | 613 Handle<Object> exec_state, |
596 Handle<Object> event_data, | 614 Handle<Object> event_data, |
597 v8::Debug::ClientData* client_data); | 615 v8::Debug::ClientData* client_data); |
598 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); | 616 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); |
599 void ProcessDebugEvent(v8::DebugEvent event, Handle<JSObject> event_data, | 617 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); | 830 Handle<Code> code); |
813 static bool DebugBreakSlotIsPatched(Address pc); | 831 static bool DebugBreakSlotIsPatched(Address pc); |
814 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 832 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
815 }; | 833 }; |
816 | 834 |
817 | 835 |
818 } // namespace internal | 836 } // namespace internal |
819 } // namespace v8 | 837 } // namespace v8 |
820 | 838 |
821 #endif // V8_DEBUG_DEBUG_H_ | 839 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |