Index: src/execution.cc |
=================================================================== |
--- src/execution.cc (revision 1507) |
+++ src/execution.cc (working copy) |
@@ -318,6 +318,21 @@ |
} |
+bool StackGuard::IsDebugCommand() { |
+ ExecutionAccess access; |
+ return thread_local_.interrupt_flags_ & DEBUGCOMMAND; |
+} |
+ |
+ |
+void StackGuard::DebugCommand() { |
+ if (FLAG_debugger_auto_break) { |
+ ExecutionAccess access; |
+ thread_local_.interrupt_flags_ |= DEBUGCOMMAND; |
+ set_limits(kInterruptLimit, access); |
+ } |
+} |
+ |
+ |
void StackGuard::Continue(InterruptFlag after_what) { |
ExecutionAccess access; |
thread_local_.interrupt_flags_ &= ~static_cast<int>(after_what); |
@@ -556,9 +571,19 @@ |
} |
} |
- // Clear the debug request flag. |
+ // Check for debug command break only. |
+ bool debug_command_only = |
+ StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); |
+ |
+ // Clear the debug request flags. |
StackGuard::Continue(DEBUGBREAK); |
+ StackGuard::Continue(DEBUGCOMMAND); |
+ // If debug command only and already in debugger ignore it. |
+ if (debug_command_only && Debug::InDebugger()) { |
+ return Heap::undefined_value(); |
+ } |
+ |
HandleScope scope; |
// Enter the debugger. Just continue if we fail to enter the debugger. |
EnterDebugger debugger; |
@@ -567,7 +592,7 @@ |
} |
// Notify the debug event listeners. |
- Debugger::OnDebugBreak(Factory::undefined_value()); |
+ Debugger::OnDebugBreak(Factory::undefined_value(), debug_command_only); |
// Return to continue execution. |
return Heap::undefined_value(); |
@@ -575,7 +600,9 @@ |
Object* Execution::HandleStackGuardInterrupt() { |
- if (StackGuard::IsDebugBreak()) DebugBreakHelper(); |
+ if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) { |
+ DebugBreakHelper(); |
+ } |
if (StackGuard::IsPreempted()) RuntimePreempt(); |
if (StackGuard::IsInterrupted()) { |
// interrupt |