Index: runtime/observatory/bin/shell.dart |
diff --git a/runtime/observatory/bin/shell.dart b/runtime/observatory/bin/shell.dart |
index ef2459c453187fec93bae91a88494450d049a374..1a1f13c880894da79df568ded1d332d771025694 100644 |
--- a/runtime/observatory/bin/shell.dart |
+++ b/runtime/observatory/bin/shell.dart |
@@ -11,16 +11,18 @@ import 'dart:io'; |
// Simple demo for service_io library. Connects to localhost on the default |
// port, picks the first isolate, reads requests from stdin, and prints |
// results to stdout. Example session: |
-// <<< prefix /isolates/1071334835 |
+// <<< isolate isolates/1071334835 |
// >>> /classes/40 |
// <<< {"type":"Class","id":"classes\/40","name":"num","user_name":"num",... |
// >>> /objects/0 |
// >>> {"type":"Array","class":{"type":"@Class","id":"classes\/62",... |
-void repl(VM vm, String prefix, String lastResult) { |
+void repl(VM vm, Isolate isolate, String lastResult) { |
print(lastResult); |
- // TODO(turnidge): use the non-deprecated api here. |
- vm.getStringDeprecated(prefix + stdin.readLineSync()).then((String result) { |
+ Map params = { |
+ 'objectId': stdin.readLineSync(), |
+ }; |
+ isolate.invokeRpc('getObject', params).then((String result) { |
repl(vm, prefix, result); |
}); |
} |
@@ -29,7 +31,6 @@ void main() { |
String addr = 'ws://localhost:8181/ws'; |
new WebSocketVM(new WebSocketVMTarget(addr)).load().then((VM vm) { |
Isolate isolate = vm.isolates.first; |
- String prefix = '${isolate.link}'; |
- repl(vm, prefix, 'prefix $prefix'); |
+ repl(vm, isolate, 'isolate ${isolate.id}'); |
}); |
} |