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

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: more code review 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 8872557dc744f524eab4904afb53d07750fd0729..5e4dfd9d575c9aab0549c9309dc7182d2cc99e73 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());
+
+ // Only send a resume event when the isolate is not unwinding.
+ if (!error.IsUnwindError()) {
+ 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();
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698