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

Unified Diff: src/debug.cc

Issue 242034: Redo "running" field in debug-delay.js and support "suspend" command (Closed)
Patch Set: do not remove body from backtrace Created 11 years, 2 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
diff --git a/src/debug.cc b/src/debug.cc
index d4a0012a13665acf943353c7447b616bbdddc457..d3a6b5b17e1aa38438eebbdcc5fdcb5405b4e90c 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2212,21 +2212,31 @@ void Debugger::NotifyMessageHandler(v8::DebugEvent event,
return;
}
- // Get the DebugCommandProcessor.
- v8::Local<v8::Object> api_exec_state =
- v8::Utils::ToLocal(Handle<JSObject>::cast(exec_state));
- v8::Local<v8::String> fun_name =
- v8::String::New("debugCommandProcessor");
- v8::Local<v8::Function> fun =
- v8::Function::Cast(*api_exec_state->Get(fun_name));
v8::TryCatch try_catch;
- v8::Local<v8::Object> cmd_processor =
- v8::Object::Cast(*fun->Call(api_exec_state, 0, NULL));
- if (try_catch.HasCaught()) {
- PrintLn(try_catch.Exception());
- return;
+
+ // DebugCommandProcessor goes here.
+ v8::Local<v8::Object> cmd_processor;
+ {
+ v8::Local<v8::Object> api_exec_state =
+ v8::Utils::ToLocal(Handle<JSObject>::cast(exec_state));
+ v8::Local<v8::String> fun_name =
+ v8::String::New("debugCommandProcessor");
+ v8::Local<v8::Function> fun =
+ v8::Function::Cast(*api_exec_state->Get(fun_name));
+
+ v8::Handle<v8::Boolean> running =
+ auto_continue ? v8::True() : v8::False();
+ static const int kArgc = 1;
+ v8::Handle<Value> argv[kArgc] = { running };
+ cmd_processor = v8::Object::Cast(*fun->Call(api_exec_state, kArgc, argv));
+ if (try_catch.HasCaught()) {
+ PrintLn(try_catch.Exception());
+ return;
+ }
}
+ bool running = auto_continue;
+
// Process requests from the debugger.
while (true) {
// Wait for new command in the queue.
@@ -2267,7 +2277,6 @@ void Debugger::NotifyMessageHandler(v8::DebugEvent event,
// Get the response.
v8::Local<v8::String> response;
- bool running = false;
if (!try_catch.HasCaught()) {
// Get response string.
if (!response_val->IsUndefined()) {
@@ -2310,7 +2319,7 @@ void Debugger::NotifyMessageHandler(v8::DebugEvent event,
// Return from debug event processing if either the VM is put into the
// runnning state (through a continue command) or auto continue is active
// and there are no more commands queued.
- if (running || (auto_continue && !HasCommands())) {
+ if (running && !HasCommands()) {
return;
}
}
« 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