| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Simple interactive debugger shell that connects to the Dart VM's debugger | 5 // Simple interactive debugger shell that connects to the Dart VM's debugger |
| 6 // connection port. | 6 // connection port. |
| 7 | 7 |
| 8 import "dart:convert"; | 8 import "dart:convert"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 import "dart:async"; | 10 import "dart:async"; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 | 80 |
| 81 void quitShell() { | 81 void quitShell() { |
| 82 vmSubscription.cancel(); | 82 vmSubscription.cancel(); |
| 83 vmSock.close(); | 83 vmSock.close(); |
| 84 cmdo.done(); | 84 cmdo.done(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 | 87 |
| 88 Future sendCmd(Map<String, dynamic> cmd) { | 88 Future sendCmd(Map<String, dynamic> cmd) { |
| 89 var completer = new Completer(); | 89 var completer = new Completer.sync(); |
| 90 int id = cmd["id"]; | 90 int id = cmd["id"]; |
| 91 outstandingCommands[id] = completer; | 91 outstandingCommands[id] = completer; |
| 92 if (verbose) { | 92 if (verbose) { |
| 93 print("sending: '${JSON.encode(cmd)}'"); | 93 print("sending: '${JSON.encode(cmd)}'"); |
| 94 } | 94 } |
| 95 vmSock.write(JSON.encode(cmd)); | 95 vmSock.write(JSON.encode(cmd)); |
| 96 return completer.future; | 96 return completer.future; |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 print('Program exited with code $exitCode.'); | 837 print('Program exited with code $exitCode.'); |
| 838 } | 838 } |
| 839 }); | 839 }); |
| 840 | 840 |
| 841 debuggerMain(); | 841 debuggerMain(); |
| 842 }); | 842 }); |
| 843 } else { | 843 } else { |
| 844 debuggerMain(); | 844 debuggerMain(); |
| 845 } | 845 } |
| 846 } | 846 } |
| OLD | NEW |