Index: runtime/vm/debugger.cc |
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc |
index 141d82c9c0a9878bf43a5f605dc85ada80b1f51b..30ba2d992153e33fbcb6f84bfa1c9c2eef257bca 100644 |
--- a/runtime/vm/debugger.cc |
+++ b/runtime/vm/debugger.cc |
@@ -227,32 +227,7 @@ ActivationFrame::ActivationFrame( |
bool Debugger::HasEventHandler() { |
- return ((event_handler_ != NULL) || |
- Service::NeedsIsolateEvents() || |
- Service::NeedsDebugEvents()); |
-} |
- |
- |
-static bool ServiceNeedsDebuggerEvent(DebuggerEvent::EventType type) { |
- switch (type) { |
- case DebuggerEvent::kBreakpointResolved: |
- // kBreakpointResolved events are handled differently in the vm |
- // service, so suppress them here. |
- return false; |
- |
- case DebuggerEvent::kBreakpointReached: |
- case DebuggerEvent::kExceptionThrown: |
- case DebuggerEvent::kIsolateInterrupted: |
- return Service::NeedsDebugEvents(); |
- |
- case DebuggerEvent::kIsolateCreated: |
- case DebuggerEvent::kIsolateShutdown: |
- return Service::NeedsIsolateEvents(); |
- |
- default: |
- UNREACHABLE(); |
- return false; |
- } |
+ return (event_handler_ != NULL) || Service::NeedsEvents(); |
} |
@@ -264,7 +239,8 @@ void Debugger::InvokeEventHandler(DebuggerEvent* event) { |
// |
// kBreakpointResolved events are handled differently in the vm |
// service, so suppress them here. |
- if (ServiceNeedsDebuggerEvent(event->type())) { |
+ if (Service::NeedsEvents() && |
+ (event->type() != DebuggerEvent::kBreakpointResolved)) { |
ServiceEvent service_event(event); |
Service::HandleEvent(&service_event); |
} |
@@ -276,7 +252,7 @@ void Debugger::InvokeEventHandler(DebuggerEvent* event) { |
(*event_handler_)(event); |
} |
- if (ServiceNeedsDebuggerEvent(event->type()) && event->IsPauseEvent()) { |
+ if (Service::NeedsEvents() && 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()); |
@@ -319,7 +295,7 @@ void Debugger::SignalIsolateInterrupted() { |
// than the regular debugger breakpoint notifications. |
static void SendServiceBreakpointEvent(ServiceEvent::EventType type, |
SourceBreakpoint* bpt) { |
- if (Service::NeedsDebugEvents()) { |
+ if (Service::NeedsEvents()) { |
ServiceEvent service_event(Isolate::Current(), type); |
service_event.set_breakpoint(bpt); |
Service::HandleEvent(&service_event); |