Author: [EMAIL PROTECTED]
Date: Thu Dec 11 03:25:06 2008
New Revision: 966
Modified:
branches/bleeding_edge/src/debug.cc
branches/bleeding_edge/src/debug.h
Log:
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
Modified: branches/bleeding_edge/src/debug.cc
==============================================================================
--- branches/bleeding_edge/src/debug.cc (original)
+++ branches/bleeding_edge/src/debug.cc Thu Dec 11 03:25:06 2008
@@ -1701,7 +1701,7 @@
}
-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 =
@@ -1727,8 +1727,9 @@
}
} else {
PrintLn(try_catch.Exception());
- SendMessage(Vector<uint16_t>::empty());
+ return false;
}
+ return true;
}
@@ -1791,10 +1792,14 @@
}
// 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.");
Modified: branches/bleeding_edge/src/debug.h
==============================================================================
--- branches/bleeding_edge/src/debug.h (original)
+++ branches/bleeding_edge/src/debug.h Thu Dec 11 03:25:06 2008
@@ -460,7 +460,7 @@
// 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.
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---