| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 DEBUGGER_STATEMENT, | 68 DEBUGGER_STATEMENT, |
| 69 DEBUG_BREAK_SLOT, | 69 DEBUG_BREAK_SLOT, |
| 70 DEBUG_BREAK_SLOT_AT_CALL, | 70 DEBUG_BREAK_SLOT_AT_CALL, |
| 71 DEBUG_BREAK_SLOT_AT_RETURN, | 71 DEBUG_BREAK_SLOT_AT_RETURN, |
| 72 DEBUG_BREAK_SLOT_AT_TAIL_CALL, | 72 DEBUG_BREAK_SLOT_AT_TAIL_CALL, |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 const int kDebugPromiseNoID = 0; | 75 const int kDebugPromiseNoID = 0; |
| 76 const int kDebugPromiseFirstID = 1; | 76 const int kDebugPromiseFirstID = 1; |
| 77 | 77 |
| 78 enum PromiseDebugActionName { | |
| 79 kDebugNotActive, | |
| 80 kDebugAsyncFunction, | |
| 81 kDebugPromiseResolve, | |
| 82 kDebugPromiseReject, | |
| 83 kDebugPromiseResolveThenableJob, | |
| 84 kDebugPromiseCollected, | |
| 85 }; | |
| 86 | |
| 87 class BreakLocation { | 78 class BreakLocation { |
| 88 public: | 79 public: |
| 89 static BreakLocation FromFrame(StandardFrame* frame); | 80 static BreakLocation FromFrame(StandardFrame* frame); |
| 90 | 81 |
| 91 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 82 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
| 92 JavaScriptFrame* frame, | 83 JavaScriptFrame* frame, |
| 93 List<BreakLocation>* result_out); | 84 List<BreakLocation>* result_out); |
| 94 | 85 |
| 95 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 86 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } |
| 96 inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; } | 87 inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 // DebugInfo. | 403 // DebugInfo. |
| 413 class Debug { | 404 class Debug { |
| 414 public: | 405 public: |
| 415 // Debug event triggers. | 406 // Debug event triggers. |
| 416 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 407 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
| 417 | 408 |
| 418 void OnThrow(Handle<Object> exception); | 409 void OnThrow(Handle<Object> exception); |
| 419 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); | 410 void OnPromiseReject(Handle<Object> promise, Handle<Object> value); |
| 420 void OnCompileError(Handle<Script> script); | 411 void OnCompileError(Handle<Script> script); |
| 421 void OnAfterCompile(Handle<Script> script); | 412 void OnAfterCompile(Handle<Script> script); |
| 422 void OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id, | 413 void OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id); |
| 423 PromiseDebugActionName name); | |
| 424 | 414 |
| 425 // API facing. | 415 // API facing. |
| 426 void SetEventListener(Handle<Object> callback, Handle<Object> data); | 416 void SetEventListener(Handle<Object> callback, Handle<Object> data); |
| 427 void SetMessageHandler(v8::Debug::MessageHandler handler); | 417 void SetMessageHandler(v8::Debug::MessageHandler handler); |
| 428 void EnqueueCommandMessage(Vector<const uint16_t> command, | 418 void EnqueueCommandMessage(Vector<const uint16_t> command, |
| 429 v8::Debug::ClientData* client_data = NULL); | 419 v8::Debug::ClientData* client_data = NULL); |
| 430 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, | 420 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<Object> fun, |
| 431 Handle<Object> data); | 421 Handle<Object> data); |
| 432 Handle<Context> GetDebugContext(); | 422 Handle<Context> GetDebugContext(); |
| 433 void HandleDebugBreak(); | 423 void HandleDebugBreak(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 597 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
| 608 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( | 598 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( |
| 609 Handle<Object> break_points_hit); | 599 Handle<Object> break_points_hit); |
| 610 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 600 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
| 611 Handle<Object> exception, | 601 Handle<Object> exception, |
| 612 bool uncaught, | 602 bool uncaught, |
| 613 Handle<Object> promise); | 603 Handle<Object> promise); |
| 614 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 604 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
| 615 Handle<Script> script, v8::DebugEvent type); | 605 Handle<Script> script, v8::DebugEvent type); |
| 616 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<Smi> type, | 606 MUST_USE_RESULT MaybeHandle<Object> MakeAsyncTaskEvent(Handle<Smi> type, |
| 617 Handle<Smi> id, | 607 Handle<Smi> id); |
| 618 Handle<Smi> name); | |
| 619 | 608 |
| 620 // Mirror cache handling. | 609 // Mirror cache handling. |
| 621 void ClearMirrorCache(); | 610 void ClearMirrorCache(); |
| 622 | 611 |
| 623 void CallEventCallback(v8::DebugEvent event, | 612 void CallEventCallback(v8::DebugEvent event, |
| 624 Handle<Object> exec_state, | 613 Handle<Object> exec_state, |
| 625 Handle<Object> event_data, | 614 Handle<Object> event_data, |
| 626 v8::Debug::ClientData* client_data); | 615 v8::Debug::ClientData* client_data); |
| 627 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); | 616 void ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script); |
| 628 void ProcessDebugEvent(v8::DebugEvent event, Handle<JSObject> event_data, | 617 void ProcessDebugEvent(v8::DebugEvent event, Handle<JSObject> event_data, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 Handle<Code> code); | 864 Handle<Code> code); |
| 876 static bool DebugBreakSlotIsPatched(Address pc); | 865 static bool DebugBreakSlotIsPatched(Address pc); |
| 877 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 866 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 878 }; | 867 }; |
| 879 | 868 |
| 880 | 869 |
| 881 } // namespace internal | 870 } // namespace internal |
| 882 } // namespace v8 | 871 } // namespace v8 |
| 883 | 872 |
| 884 #endif // V8_DEBUG_DEBUG_H_ | 873 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |