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_H_ | 5 #ifndef V8_DEBUG_H_ |
6 #define V8_DEBUG_H_ | 6 #define V8_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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 504 |
505 void UpdateState(); | 505 void UpdateState(); |
506 void Unload(); | 506 void Unload(); |
507 void SetNextBreakId() { | 507 void SetNextBreakId() { |
508 thread_local_.break_id_ = ++thread_local_.break_count_; | 508 thread_local_.break_id_ = ++thread_local_.break_count_; |
509 } | 509 } |
510 | 510 |
511 // Check whether there are commands in the command queue. | 511 // Check whether there are commands in the command queue. |
512 inline bool has_commands() const { return !command_queue_.IsEmpty(); } | 512 inline bool has_commands() const { return !command_queue_.IsEmpty(); } |
513 inline bool ignore_events() const { return is_suppressed_ || !is_active_; } | 513 inline bool ignore_events() const { return is_suppressed_ || !is_active_; } |
| 514 inline bool break_disabled() const { |
| 515 return break_disabled_ || in_debug_event_listener_; |
| 516 } |
514 | 517 |
515 void OnException(Handle<Object> exception, bool uncaught, | 518 void OnException(Handle<Object> exception, bool uncaught, |
516 Handle<Object> promise); | 519 Handle<Object> promise); |
517 | 520 |
518 // Constructors for debug event objects. | 521 // Constructors for debug event objects. |
519 MUST_USE_RESULT MaybeHandle<Object> MakeJSObject( | 522 MUST_USE_RESULT MaybeHandle<Object> MakeJSObject( |
520 const char* constructor_name, | 523 const char* constructor_name, |
521 int argc, | 524 int argc, |
522 Handle<Object> argv[]); | 525 Handle<Object> argv[]); |
523 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 526 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 static const int kQueueInitialSize = 4; | 584 static const int kQueueInitialSize = 4; |
582 base::Semaphore command_received_; // Signaled for each command received. | 585 base::Semaphore command_received_; // Signaled for each command received. |
583 LockingCommandMessageQueue command_queue_; | 586 LockingCommandMessageQueue command_queue_; |
584 LockingCommandMessageQueue event_command_queue_; | 587 LockingCommandMessageQueue event_command_queue_; |
585 | 588 |
586 bool is_active_; | 589 bool is_active_; |
587 bool is_suppressed_; | 590 bool is_suppressed_; |
588 bool live_edit_enabled_; | 591 bool live_edit_enabled_; |
589 bool has_break_points_; | 592 bool has_break_points_; |
590 bool break_disabled_; | 593 bool break_disabled_; |
| 594 bool in_debug_event_listener_; |
591 bool break_on_exception_; | 595 bool break_on_exception_; |
592 bool break_on_uncaught_exception_; | 596 bool break_on_uncaught_exception_; |
593 | 597 |
594 ScriptCache* script_cache_; // Cache of all scripts in the heap. | 598 ScriptCache* script_cache_; // Cache of all scripts in the heap. |
595 DebugInfoListNode* debug_info_list_; // List of active debug info objects. | 599 DebugInfoListNode* debug_info_list_; // List of active debug info objects. |
596 | 600 |
597 // Storage location for jump when exiting debug break calls. | 601 // Storage location for jump when exiting debug break calls. |
598 // Note that this address is not GC safe. It should be computed immediately | 602 // Note that this address is not GC safe. It should be computed immediately |
599 // before returning to the DebugBreakCallHelper. | 603 // before returning to the DebugBreakCallHelper. |
600 Address after_break_target_; | 604 Address after_break_target_; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 bool failed_; // Did the debug context fail to load? | 695 bool failed_; // Did the debug context fail to load? |
692 SaveContext save_; // Saves previous context. | 696 SaveContext save_; // Saves previous context. |
693 PostponeInterruptsScope no_termination_exceptons_; | 697 PostponeInterruptsScope no_termination_exceptons_; |
694 }; | 698 }; |
695 | 699 |
696 | 700 |
697 // Stack allocated class for disabling break. | 701 // Stack allocated class for disabling break. |
698 class DisableBreak BASE_EMBEDDED { | 702 class DisableBreak BASE_EMBEDDED { |
699 public: | 703 public: |
700 explicit DisableBreak(Debug* debug, bool disable_break) | 704 explicit DisableBreak(Debug* debug, bool disable_break) |
701 : debug_(debug), old_state_(debug->break_disabled_) { | 705 : debug_(debug), |
| 706 previous_break_disabled_(debug->break_disabled_), |
| 707 previous_in_debug_event_listener_(debug->in_debug_event_listener_) { |
702 debug_->break_disabled_ = disable_break; | 708 debug_->break_disabled_ = disable_break; |
| 709 debug_->in_debug_event_listener_ = disable_break; |
703 } | 710 } |
704 ~DisableBreak() { debug_->break_disabled_ = old_state_; } | 711 ~DisableBreak() { |
| 712 debug_->break_disabled_ = previous_break_disabled_; |
| 713 debug_->in_debug_event_listener_ = previous_in_debug_event_listener_; |
| 714 } |
705 | 715 |
706 private: | 716 private: |
707 Debug* debug_; | 717 Debug* debug_; |
708 bool old_state_; | 718 bool previous_break_disabled_; |
| 719 bool previous_in_debug_event_listener_; |
709 DISALLOW_COPY_AND_ASSIGN(DisableBreak); | 720 DISALLOW_COPY_AND_ASSIGN(DisableBreak); |
710 }; | 721 }; |
711 | 722 |
712 | 723 |
713 class SuppressDebug BASE_EMBEDDED { | 724 class SuppressDebug BASE_EMBEDDED { |
714 public: | 725 public: |
715 explicit SuppressDebug(Debug* debug) | 726 explicit SuppressDebug(Debug* debug) |
716 : debug_(debug), old_state_(debug->is_suppressed_) { | 727 : debug_(debug), old_state_(debug->is_suppressed_) { |
717 debug_->is_suppressed_ = true; | 728 debug_->is_suppressed_ = true; |
718 } | 729 } |
(...skipping 27 matching lines...) Expand all Loading... |
746 // several frames above. | 757 // several frames above. |
747 // There is no calling conventions here, because it never actually gets | 758 // There is no calling conventions here, because it never actually gets |
748 // called, it only gets returned to. | 759 // called, it only gets returned to. |
749 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 760 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
750 }; | 761 }; |
751 | 762 |
752 | 763 |
753 } } // namespace v8::internal | 764 } } // namespace v8::internal |
754 | 765 |
755 #endif // V8_DEBUG_H_ | 766 #endif // V8_DEBUG_H_ |
OLD | NEW |