Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: src/debug.cc

Issue 14886: Bring toiger up to date with bleeding edge 984. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 1004)
+++ src/debug.cc (working copy)
@@ -849,7 +849,12 @@
void Debug::FloodHandlerWithOneShot() {
+ // Iterate through the JavaScript stack looking for handlers.
StackFrame::Id id = Top::break_frame_id();
+ if (id == StackFrame::NO_ID) {
+ // If there is no JavaScript stack don't do anything.
+ return;
+ }
for (JavaScriptFrameIterator it(id); !it.done(); it.Advance()) {
JavaScriptFrame* frame = it.frame();
if (frame->HasHandler()) {
@@ -886,6 +891,10 @@
// hitting a break point. In other situations (e.g. unhandled exception) the
// debug frame is not present.
StackFrame::Id id = Top::break_frame_id();
+ if (id == StackFrame::NO_ID) {
+ // If there is no JavaScript stack don't do anything.
+ return;
+ }
JavaScriptFrameIterator frames_it(id);
JavaScriptFrame* frame = frames_it.frame();
@@ -1700,7 +1709,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 =
@@ -1726,8 +1735,9 @@
}
} else {
PrintLn(try_catch.Exception());
- SendMessage(Vector<uint16_t>::empty());
+ return false;
}
+ return true;
}
@@ -1790,10 +1800,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.");
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698