Chromium Code Reviews| 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(); |
| } |