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

Unified Diff: src/debug.cc

Issue 1032353002: Make sure debugger is ready for breakpoins when we process 'debugger' statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: TODO to clean-up threading issues added Created 5 years, 9 months 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 | test/mjsunit/debug-allscopes-on-debugger.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 2ef40c4edbdc581c2e8877db64859e39b89029af..3866a1e97886c99cd3e0e9b5da7bb1b212c852d0 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -3089,8 +3089,19 @@ void Debug::HandleDebugBreak() {
bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() &&
!isolate_->stack_guard()->CheckDebugBreak();
+ bool is_debugger_statement = !isolate_->stack_guard()->CheckDebugCommand() &&
+ !isolate_->stack_guard()->CheckDebugBreak();
+
isolate_->stack_guard()->ClearDebugBreak();
+ if (is_debugger_statement) {
+ // If we have been called via 'debugger' Javascript statement,
+ // we might not be prepared for breakpoints.
+ // TODO(dslomov,yangguo): CheckDebugBreak may race with RequestDebugBreak.
+ // Revisit this to clean-up.
+ HandleScope handle_scope(isolate_);
+ PrepareForBreakPoints();
+ }
ProcessDebugMessages(debug_command_only);
}
« no previous file with comments | « no previous file | test/mjsunit/debug-allscopes-on-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698