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

Unified Diff: runtime/observatory/tests/service/test_helper.dart

Issue 1312763010: Support column-based breakpoints in the VM and Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: hausner review Created 5 years, 3 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/get_version_rpc_test.dart ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/test_helper.dart
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 6c6c223bdfacbd4e46e1ce522c49cfb4a4c032f4..fa453df163b618b13e2626caaab1aec650633e94 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -164,7 +164,6 @@ Future<Isolate> hasStoppedAtBreakpoint(Isolate isolate) {
isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
var subscription;
subscription = stream.listen((ServiceEvent event) {
- print("Event: $event");
if (event.kind == ServiceEvent.kPauseBreakpoint) {
print('Breakpoint reached');
subscription.cancel();
@@ -195,6 +194,41 @@ Future<Isolate> hasStoppedAtBreakpoint(Isolate isolate) {
}
+Future<Isolate> hasPausedAtStart(Isolate isolate) {
+ // Set up a listener to wait for breakpoint events.
+ Completer completer = new Completer();
+ isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
+ var subscription;
+ subscription = stream.listen((ServiceEvent event) {
+ if (event.kind == ServiceEvent.kPauseStart) {
+ print('Paused at isolate start');
+ subscription.cancel();
+ if (completer != null) {
+ // Reload to update isolate.pauseEvent.
+ completer.complete(isolate.reload());
+ completer = null;
+ }
+ }
+ });
+
+ // Pause may have happened before we subscribed.
+ isolate.reload().then((_) {
+ if ((isolate.pauseEvent != null) &&
+ (isolate.pauseEvent.kind == ServiceEvent.kPauseStart)) {
+ print('Paused at isolate start');
+ subscription.cancel();
+ if (completer != null) {
+ completer.complete(isolate);
+ completer = null;
+ }
+ }
+ });
+ });
+
+ return completer.future;
+}
+
+
// Currying is your friend.
IsolateTest setBreakpointAtLine(int line) {
return (Isolate isolate) async {
« no previous file with comments | « runtime/observatory/tests/service/get_version_rpc_test.dart ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698