}
-void DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) {
+bool DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) {
v8::HandleScope scope;
// Call toJSONProtocol on the debug event object.
v8::Local<v8::Object> api_event_data =
}
} else {
PrintLn(try_catch.Exception());
- SendMessage(Vector<uint16_t>::empty());
+ return false;
}
+ return true;
}
}
// Notify the debugger that a debug event has occurred.
- host_running_ = false;
- SetEventJSONFromEvent(event_data);
+ bool success = SetEventJSONFromEvent(event_data);
+ if (!success) {
+ // If failed to notify debugger just continue running.
+ return;
+ }
// Wait for requests from the debugger.
+ host_running_ = false;
while (true) {
command_received_->Wait();
Logger::DebugTag("Got request from command queue, in interactive loop.");
// which forwards it to the debug_message_handler set by the API.
void SendMessage(Vector<uint16_t> event_json);
// Formats an event into JSON, and calls SendMessage.
- void SetEventJSONFromEvent(Handle<Object> event_data);
+ bool SetEventJSONFromEvent(Handle<Object> event_data);
// Puts a command coming from the public API on the queue. Called
// by the API client thread. This is where the API client hands off
// processing of the command to the DebugMessageThread thread.