Commit 4ddee482 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Continue running if failing to make a debug event into a JSON event for sending to the debugger.

This partly fixes Chromium issue 5349 (http://code.google.com/p/chromium/issues/detail?id=5349).
Review URL: http://codereview.chromium.org/13384

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@966 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6297a191
...@@ -1701,7 +1701,7 @@ void DebugMessageThread::SendMessage(Vector<uint16_t> message) { ...@@ -1701,7 +1701,7 @@ void DebugMessageThread::SendMessage(Vector<uint16_t> message) {
} }
void DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) { bool DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) {
v8::HandleScope scope; v8::HandleScope scope;
// Call toJSONProtocol on the debug event object. // Call toJSONProtocol on the debug event object.
v8::Local<v8::Object> api_event_data = v8::Local<v8::Object> api_event_data =
...@@ -1727,8 +1727,9 @@ void DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) { ...@@ -1727,8 +1727,9 @@ void DebugMessageThread::SetEventJSONFromEvent(Handle<Object> event_data) {
} }
} else { } else {
PrintLn(try_catch.Exception()); PrintLn(try_catch.Exception());
SendMessage(Vector<uint16_t>::empty()); return false;
} }
return true;
} }
...@@ -1791,10 +1792,14 @@ void DebugMessageThread::DebugEvent(v8::DebugEvent event, ...@@ -1791,10 +1792,14 @@ void DebugMessageThread::DebugEvent(v8::DebugEvent event,
} }
// Notify the debugger that a debug event has occurred. // Notify the debugger that a debug event has occurred.
host_running_ = false; bool success = SetEventJSONFromEvent(event_data);
SetEventJSONFromEvent(event_data); if (!success) {
// If failed to notify debugger just continue running.
return;
}
// Wait for requests from the debugger. // Wait for requests from the debugger.
host_running_ = false;
while (true) { while (true) {
command_received_->Wait(); command_received_->Wait();
Logger::DebugTag("Got request from command queue, in interactive loop."); Logger::DebugTag("Got request from command queue, in interactive loop.");
......
...@@ -460,7 +460,7 @@ class DebugMessageThread: public Thread { ...@@ -460,7 +460,7 @@ class DebugMessageThread: public Thread {
// which forwards it to the debug_message_handler set by the API. // which forwards it to the debug_message_handler set by the API.
void SendMessage(Vector<uint16_t> event_json); void SendMessage(Vector<uint16_t> event_json);
// Formats an event into JSON, and calls SendMessage. // 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 // 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 // by the API client thread. This is where the API client hands off
// processing of the command to the DebugMessageThread thread. // processing of the command to the DebugMessageThread thread.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment