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

Unified Diff: src/runtime/runtime-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: CR feedback 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/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index e802ea6975383562edb28cf3754d23e3c733da0f..5ea98dae22c6a5d65b6619d8e5dc45edb886c77c 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -20,6 +20,15 @@ namespace internal {
RUNTIME_FUNCTION(Runtime_DebugBreak) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 0);
+ bool is_debugger_statement = !isolate->stack_guard()->CheckDebugCommand() &&
+ !isolate->stack_guard()->CheckDebugBreak();
yurys 2015/03/26 19:44:48 RequestDebugBreak can be called on another thread.
Yang 2015/03/27 09:10:21 How about we just check whether the debugger is ac
+
+ if (is_debugger_statement) {
+ // If we have been called via 'debugger' Javascript statement,
+ // we might not be prepared for breakpoints.
+ HandleScope handle_scope(isolate);
+ isolate->debug()->PrepareForBreakPoints();
+ }
isolate->debug()->HandleDebugBreak();
return isolate->heap()->undefined_value();
}
« 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