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

Unified Diff: src/debug.cc

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 | « src/debug.h ('k') | test/mjsunit/regress/regress-crbug-432493.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 3029adba9d53403677ac35ed4ce05ba2ac7dfde3..a5bfea80e68367ff67ad56570f194b7bf0b61750 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -40,6 +40,7 @@ Debug::Debug(Isolate* isolate)
live_edit_enabled_(true), // TODO(yangguo): set to false by default.
has_break_points_(false),
break_disabled_(false),
+ in_debug_event_listener_(false),
break_on_exception_(false),
break_on_uncaught_exception_(false),
script_cache_(NULL),
@@ -872,7 +873,7 @@ void Debug::Break(Arguments args, JavaScriptFrame* frame) {
LiveEdit::InitializeThreadLocal(this);
// Just continue if breaks are disabled or debugger cannot be loaded.
- if (break_disabled_) return;
+ if (break_disabled()) return;
// Enter the debugger.
DebugScope debug_scope(this);
@@ -2812,7 +2813,8 @@ void Debug::CallEventCallback(v8::DebugEvent event,
Handle<Object> exec_state,
Handle<Object> event_data,
v8::Debug::ClientData* client_data) {
- DisableBreak no_break(this, true);
+ bool previous = in_debug_event_listener_;
+ in_debug_event_listener_ = true;
if (event_listener_->IsForeign()) {
// Invoke the C debug event listener.
v8::Debug::EventCallback callback =
@@ -2836,6 +2838,7 @@ void Debug::CallEventCallback(v8::DebugEvent event,
Execution::TryCall(Handle<JSFunction>::cast(event_listener_),
global, arraysize(argv), argv);
}
+ in_debug_event_listener_ = previous;
}
@@ -3089,7 +3092,7 @@ void Debug::HandleDebugBreak() {
// Ignore debug break during bootstrapping.
if (isolate_->bootstrapper()->IsActive()) return;
// Just continue if breaks are disabled.
- if (break_disabled_) return;
+ if (break_disabled()) return;
// Ignore debug break if debugger is not active.
if (!is_active()) return;
« no previous file with comments | « src/debug.h ('k') | test/mjsunit/regress/regress-crbug-432493.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698