| 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;
|
| }
|
| }
|
|
|