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

Unified Diff: runtime/vm/debugger.cc

Issue 1371193005: VM restart + shutdown fixes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix ups Created 5 years, 2 months 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
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 0b614586061f31bab6b77c0fff21fa58e02ea47a..b700aee5b932f1fecc1a6bb955918cfb2a2831a9 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -310,9 +310,16 @@ void Debugger::InvokeEventHandler(DebuggerEvent* event) {
if (ServiceNeedsDebuggerEvent(event->type()) && event->IsPauseEvent()) {
// If we were paused, notify the service that we have resumed.
- ServiceEvent service_event(event->isolate(), ServiceEvent::kResume);
- service_event.set_top_frame(event->top_frame());
- Service::HandleEvent(&service_event);
+ const Error& error =
+ Error::Handle(isolate_, isolate_->object_store()->sticky_error());
+ ASSERT(error.IsNull() || error.IsUnwindError());
+
+ // Don't send a resume event when the isolate is unwinding.
+ if (!error.IsUnwindError()) {
Cutch 2015/10/05 18:10:46 Based on the comment I would expect to see: if (e
turnidge 2015/10/05 22:18:24 Changed the sense of the comment. For some reason
+ ServiceEvent service_event(event->isolate(), ServiceEvent::kResume);
+ service_event.set_top_frame(event->top_frame());
+ Service::HandleEvent(&service_event);
+ }
}
}
@@ -350,9 +357,6 @@ RawError* Debugger::SignalIsolateInterrupted() {
OS::Print("[!] Embedder api: terminating isolate:\n"
"\tisolate: %s\n", isolate_->name());
}
- // TODO(turnidge): We should give the message handler a way to
- // detect when an isolate is unwinding.
- isolate_->message_handler()->set_pause_on_exit(false);
const String& msg =
String::Handle(String::New("isolate terminated by embedder"));
return UnwindError::New(msg);
@@ -362,6 +366,7 @@ RawError* Debugger::SignalIsolateInterrupted() {
// If any error occurred while in the debug message loop, return it here.
const Error& error =
Error::Handle(isolate_, isolate_->object_store()->sticky_error());
+ ASSERT(error.IsNull() || error.IsUnwindError());
isolate_->object_store()->clear_sticky_error();
return error.raw();
}

Powered by Google App Engine
This is Rietveld 408576698