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

Unified Diff: runtime/vm/debugger.cc

Issue 1143783003: Add the streamListen and streamCancel rpcs to the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: before commit Created 5 years, 7 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/observatory/tests/service/test_helper.dart ('k') | runtime/vm/heap.cc » ('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 30ba2d992153e33fbcb6f84bfa1c9c2eef257bca..141d82c9c0a9878bf43a5f605dc85ada80b1f51b 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -227,7 +227,32 @@ ActivationFrame::ActivationFrame(
bool Debugger::HasEventHandler() {
- return (event_handler_ != NULL) || Service::NeedsEvents();
+ 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;
+ }
}
@@ -239,8 +264,7 @@ void Debugger::InvokeEventHandler(DebuggerEvent* event) {
//
// kBreakpointResolved events are handled differently in the vm
// service, so suppress them here.
- if (Service::NeedsEvents() &&
- (event->type() != DebuggerEvent::kBreakpointResolved)) {
+ if (ServiceNeedsDebuggerEvent(event->type())) {
ServiceEvent service_event(event);
Service::HandleEvent(&service_event);
}
@@ -252,7 +276,7 @@ void Debugger::InvokeEventHandler(DebuggerEvent* event) {
(*event_handler_)(event);
}
- if (Service::NeedsEvents() && event->IsPauseEvent()) {
+ 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());
@@ -295,7 +319,7 @@ void Debugger::SignalIsolateInterrupted() {
// than the regular debugger breakpoint notifications.
static void SendServiceBreakpointEvent(ServiceEvent::EventType type,
SourceBreakpoint* bpt) {
- if (Service::NeedsEvents()) {
+ if (Service::NeedsDebugEvents()) {
ServiceEvent service_event(Isolate::Current(), type);
service_event.set_breakpoint(bpt);
Service::HandleEvent(&service_event);
« no previous file with comments | « runtime/observatory/tests/service/test_helper.dart ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698