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

Unified Diff: src/execution.cc

Issue 42173: Added automatic debug break for processing debugger commands (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « src/execution.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/execution.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698