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

Unified Diff: src/debug.cc

Issue 100034: Support afterCompile event (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 8 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 | src/debug-delay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 1793)
+++ src/debug.cc (working copy)
@@ -1612,7 +1612,7 @@
}
// Process debug event
- ProcessDebugEvent(v8::BeforeCompile, event_data, false);
+ ProcessDebugEvent(v8::BeforeCompile, event_data, true);
}
@@ -1673,7 +1673,7 @@
return;
}
// Process debug event
- ProcessDebugEvent(v8::AfterCompile, event_data, false);
+ ProcessDebugEvent(v8::AfterCompile, event_data, true);
}
@@ -1698,7 +1698,7 @@
return;
}
// Process debug event.
- ProcessDebugEvent(v8::NewFunction, event_data, false);
+ ProcessDebugEvent(v8::NewFunction, event_data, true);
}
@@ -1776,17 +1776,18 @@
if (!Debug::Load()) return;
// Process the individual events.
- bool interactive = false;
+ bool sendEventMessage = false;
switch (event) {
case v8::Break:
- interactive = true; // Break event is always interactive
+ sendEventMessage = !auto_continue;
break;
case v8::Exception:
- interactive = true; // Exception event is always interactive
+ sendEventMessage = true;
break;
case v8::BeforeCompile:
break;
case v8::AfterCompile:
+ sendEventMessage = true;
break;
case v8::NewFunction:
break;
@@ -1794,9 +1795,21 @@
UNREACHABLE();
}
- // Done if not interactive.
- if (!interactive) return;
+ // The debug command interrupt flag might have been set when the command was
+ // added. It should be enough to clear the flag only once while we are in the
+ // debugger.
+ ASSERT(Debug::InDebugger());
+ StackGuard::Continue(DEBUGCOMMAND);
+ // Notify the debugger that a debug event has occurred unless auto continue is
+ // active in which case no event is send.
+ if (sendEventMessage) {
+ InvokeMessageHandlerWithEvent(event_data);
+ }
+ if (auto_continue && !HasCommands()) {
+ return;
+ }
+
// Get the DebugCommandProcessor.
v8::Local<v8::Object> api_exec_state =
v8::Utils::ToLocal(Handle<JSObject>::cast(exec_state));
@@ -1812,16 +1825,6 @@
return;
}
- // Notify the debugger that a debug event has occurred unless auto continue is
- // active in which case no event is send.
- if (!auto_continue) {
- bool success = InvokeMessageHandlerWithEvent(event_data);
- if (!success) {
- // If failed to notify debugger just continue running.
- return;
- }
- }
-
// Process requests from the debugger.
while (true) {
// Wait for new command in the queue.
@@ -1837,10 +1840,6 @@
command_received_->Wait();
}
- // The debug command interrupt flag might have been set when the command was
- // added.
- StackGuard::Continue(DEBUGCOMMAND);
-
// Get the command from the queue.
CommandMessage command = command_queue_.Get();
Logger::DebugTag("Got request from command queue, in interactive loop.");
« no previous file with comments | « no previous file | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698