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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index b8348fd52af0dbd4656e4ea88ec3535d1656591b..ea17cb0e9c82c9f2844c3267d7d89d511409bb1a 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -515,6 +515,9 @@ class Debug {
// Check whether there are commands in the command queue.
inline bool has_commands() const { return !command_queue_.IsEmpty(); }
inline bool ignore_events() const { return is_suppressed_ || !is_active_; }
+ inline bool break_disabled() const {
+ return break_disabled_ || in_debug_event_listener_;
+ }
void OnException(Handle<Object> exception, bool uncaught,
Handle<Object> promise);
@@ -592,6 +595,7 @@ class Debug {
bool live_edit_enabled_;
bool has_break_points_;
bool break_disabled_;
+ bool in_debug_event_listener_;
bool break_on_exception_;
bool break_on_uncaught_exception_;
@@ -702,14 +706,21 @@ class DebugScope BASE_EMBEDDED {
class DisableBreak BASE_EMBEDDED {
public:
explicit DisableBreak(Debug* debug, bool disable_break)
- : debug_(debug), old_state_(debug->break_disabled_) {
+ : debug_(debug),
+ previous_break_disabled_(debug->break_disabled_),
+ previous_in_debug_event_listener_(debug->in_debug_event_listener_) {
debug_->break_disabled_ = disable_break;
+ debug_->in_debug_event_listener_ = disable_break;
+ }
+ ~DisableBreak() {
+ debug_->break_disabled_ = previous_break_disabled_;
+ debug_->in_debug_event_listener_ = previous_in_debug_event_listener_;
}
- ~DisableBreak() { debug_->break_disabled_ = old_state_; }
private:
Debug* debug_;
- bool old_state_;
+ bool previous_break_disabled_;
+ bool previous_in_debug_event_listener_;
DISALLOW_COPY_AND_ASSIGN(DisableBreak);
};
« 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