| Index: src/debug.cc
|
| diff --git a/src/debug.cc b/src/debug.cc
|
| index 1d90c2999a2bd0efb19080b1fac1ccca6beffaa7..6d033a7416e191a80bba50cdab215f61025a506e 100644
|
| --- a/src/debug.cc
|
| +++ b/src/debug.cc
|
| @@ -2735,8 +2735,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);
|
| }
|
|
|
|
|