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

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: 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') | test/mjsunit/regress/regress-crbug-432493.js » ('J')
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..7aa2f1387a5972bbd5b567c4ec349eeb282442b9 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_ || break_disabled_for_event_;
+ }
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 break_disabled_for_event_;
yurys 2014/11/18 12:53:33 I'd rather call it something like in_debug_listene
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_break_disabled_for_event_(debug->break_disabled_for_event_) {
debug_->break_disabled_ = disable_break;
+ debug_->break_disabled_for_event_ = disable_break;
+ }
+ ~DisableBreak() {
+ debug_->break_disabled_ = previous_break_disabled_;
+ debug_->break_disabled_for_event_ = previous_break_disabled_for_event_;
}
- ~DisableBreak() { debug_->break_disabled_ = old_state_; }
private:
Debug* debug_;
- bool old_state_;
+ bool previous_break_disabled_ : 1;
yurys 2014/11/18 12:53:33 Does it really make sense to use bit fields here?
+ bool previous_break_disabled_for_event_ : 1;
DISALLOW_COPY_AND_ASSIGN(DisableBreak);
};
« no previous file with comments | « no previous file | src/debug.cc » ('j') | test/mjsunit/regress/regress-crbug-432493.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698