From 4ddee482186c87a4c8ddc770e398f4b29f71aec9 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Thu, 11 Dec 2008 11:25:06 +0000 Subject: [PATCH] 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 --- src/debug.cc | 13 +++++++++---- src/debug.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 820a4a7a4..027c89b64 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1701,7 +1701,7 @@ void DebugMessageThread::SendMessage(Vector message) { } -void DebugMessageThread::SetEventJSONFromEvent(Handle event_data) { +bool DebugMessageThread::SetEventJSONFromEvent(Handle event_data) { v8::HandleScope scope; // Call toJSONProtocol on the debug event object. v8::Local api_event_data = @@ -1727,8 +1727,9 @@ void DebugMessageThread::SetEventJSONFromEvent(Handle event_data) { } } else { PrintLn(try_catch.Exception()); - SendMessage(Vector::empty()); + return false; } + return true; } @@ -1791,10 +1792,14 @@ void DebugMessageThread::DebugEvent(v8::DebugEvent event, } // 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."); diff --git a/src/debug.h b/src/debug.h index b86e62bf4..fdb80bd20 100644 --- a/src/debug.h +++ b/src/debug.h @@ -460,7 +460,7 @@ class DebugMessageThread: public Thread { // which forwards it to the debug_message_handler set by the API. void SendMessage(Vector event_json); // Formats an event into JSON, and calls SendMessage. - void SetEventJSONFromEvent(Handle event_data); + bool SetEventJSONFromEvent(Handle 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. -- 2.34.1