Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: src/debug.h

Issue 728103008: Fix disabling all break points from within the debug event callback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 void UpdateState(); 509 void UpdateState();
510 void Unload(); 510 void Unload();
511 void SetNextBreakId() { 511 void SetNextBreakId() {
512 thread_local_.break_id_ = ++thread_local_.break_count_; 512 thread_local_.break_id_ = ++thread_local_.break_count_;
513 } 513 }
514 514
515 // Check whether there are commands in the command queue. 515 // Check whether there are commands in the command queue.
516 inline bool has_commands() const { return !command_queue_.IsEmpty(); } 516 inline bool has_commands() const { return !command_queue_.IsEmpty(); }
517 inline bool ignore_events() const { return is_suppressed_ || !is_active_; } 517 inline bool ignore_events() const { return is_suppressed_ || !is_active_; }
518 inline bool break_disabled() const {
519 return break_disabled_ || in_debug_event_listener_;
520 }
518 521
519 void OnException(Handle<Object> exception, bool uncaught, 522 void OnException(Handle<Object> exception, bool uncaught,
520 Handle<Object> promise); 523 Handle<Object> promise);
521 524
522 // Constructors for debug event objects. 525 // Constructors for debug event objects.
523 MUST_USE_RESULT MaybeHandle<Object> MakeJSObject( 526 MUST_USE_RESULT MaybeHandle<Object> MakeJSObject(
524 const char* constructor_name, 527 const char* constructor_name,
525 int argc, 528 int argc,
526 Handle<Object> argv[]); 529 Handle<Object> argv[]);
527 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); 530 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 static const int kQueueInitialSize = 4; 588 static const int kQueueInitialSize = 4;
586 base::Semaphore command_received_; // Signaled for each command received. 589 base::Semaphore command_received_; // Signaled for each command received.
587 LockingCommandMessageQueue command_queue_; 590 LockingCommandMessageQueue command_queue_;
588 LockingCommandMessageQueue event_command_queue_; 591 LockingCommandMessageQueue event_command_queue_;
589 592
590 bool is_active_; 593 bool is_active_;
591 bool is_suppressed_; 594 bool is_suppressed_;
592 bool live_edit_enabled_; 595 bool live_edit_enabled_;
593 bool has_break_points_; 596 bool has_break_points_;
594 bool break_disabled_; 597 bool break_disabled_;
598 bool in_debug_event_listener_;
595 bool break_on_exception_; 599 bool break_on_exception_;
596 bool break_on_uncaught_exception_; 600 bool break_on_uncaught_exception_;
597 601
598 ScriptCache* script_cache_; // Cache of all scripts in the heap. 602 ScriptCache* script_cache_; // Cache of all scripts in the heap.
599 DebugInfoListNode* debug_info_list_; // List of active debug info objects. 603 DebugInfoListNode* debug_info_list_; // List of active debug info objects.
600 604
601 // Storage location for jump when exiting debug break calls. 605 // Storage location for jump when exiting debug break calls.
602 // Note that this address is not GC safe. It should be computed immediately 606 // Note that this address is not GC safe. It should be computed immediately
603 // before returning to the DebugBreakCallHelper. 607 // before returning to the DebugBreakCallHelper.
604 Address after_break_target_; 608 Address after_break_target_;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 bool failed_; // Did the debug context fail to load? 699 bool failed_; // Did the debug context fail to load?
696 SaveContext save_; // Saves previous context. 700 SaveContext save_; // Saves previous context.
697 PostponeInterruptsScope no_termination_exceptons_; 701 PostponeInterruptsScope no_termination_exceptons_;
698 }; 702 };
699 703
700 704
701 // Stack allocated class for disabling break. 705 // Stack allocated class for disabling break.
702 class DisableBreak BASE_EMBEDDED { 706 class DisableBreak BASE_EMBEDDED {
703 public: 707 public:
704 explicit DisableBreak(Debug* debug, bool disable_break) 708 explicit DisableBreak(Debug* debug, bool disable_break)
705 : debug_(debug), old_state_(debug->break_disabled_) { 709 : debug_(debug),
710 previous_break_disabled_(debug->break_disabled_),
711 previous_in_debug_event_listener_(debug->in_debug_event_listener_) {
706 debug_->break_disabled_ = disable_break; 712 debug_->break_disabled_ = disable_break;
713 debug_->in_debug_event_listener_ = disable_break;
707 } 714 }
708 ~DisableBreak() { debug_->break_disabled_ = old_state_; } 715 ~DisableBreak() {
716 debug_->break_disabled_ = previous_break_disabled_;
717 debug_->in_debug_event_listener_ = previous_in_debug_event_listener_;
718 }
709 719
710 private: 720 private:
711 Debug* debug_; 721 Debug* debug_;
712 bool old_state_; 722 bool previous_break_disabled_;
723 bool previous_in_debug_event_listener_;
713 DISALLOW_COPY_AND_ASSIGN(DisableBreak); 724 DISALLOW_COPY_AND_ASSIGN(DisableBreak);
714 }; 725 };
715 726
716 727
717 class SuppressDebug BASE_EMBEDDED { 728 class SuppressDebug BASE_EMBEDDED {
718 public: 729 public:
719 explicit SuppressDebug(Debug* debug) 730 explicit SuppressDebug(Debug* debug)
720 : debug_(debug), old_state_(debug->is_suppressed_) { 731 : debug_(debug), old_state_(debug->is_suppressed_) {
721 debug_->is_suppressed_ = true; 732 debug_->is_suppressed_ = true;
722 } 733 }
(...skipping 27 matching lines...) Expand all
750 // several frames above. 761 // several frames above.
751 // There is no calling conventions here, because it never actually gets 762 // There is no calling conventions here, because it never actually gets
752 // called, it only gets returned to. 763 // called, it only gets returned to.
753 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); 764 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm);
754 }; 765 };
755 766
756 767
757 } } // namespace v8::internal 768 } } // namespace v8::internal
758 769
759 #endif // V8_DEBUG_H_ 770 #endif // V8_DEBUG_H_
OLDNEW
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698