| 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:io"; | 8 import "dart:io"; |
| 9 import "dart:json" as json; | 9 import "dart:json" as json; |
| 10 import "dart:utf"; | 10 import "dart:utf"; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 | 64 |
| 65 Future sendCmd(Map<String, dynamic> cmd) { | 65 Future sendCmd(Map<String, dynamic> cmd) { |
| 66 var completer = new Completer(); | 66 var completer = new Completer(); |
| 67 int id = cmd["id"]; | 67 int id = cmd["id"]; |
| 68 outstandingCommands[id] = completer; | 68 outstandingCommands[id] = completer; |
| 69 if (verbose) { | 69 if (verbose) { |
| 70 print("sending: '${json.stringify(cmd)}'"); | 70 print("sending: '${json.stringify(cmd)}'"); |
| 71 } | 71 } |
| 72 vmSock.addString(json.stringify(cmd)); | 72 vmSock.write(json.stringify(cmd)); |
| 73 return completer.future; | 73 return completer.future; |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 void processCommand(String cmdLine) { | 77 void processCommand(String cmdLine) { |
| 78 seqNum++; | 78 seqNum++; |
| 79 var args = cmdLine.split(' '); | 79 var args = cmdLine.split(' '); |
| 80 if (args.length == 0) { | 80 if (args.length == 0) { |
| 81 return; | 81 return; |
| 82 } | 82 } |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 process.stdin.close(); | 558 process.stdin.close(); |
| 559 process.exitCode.then((int exitCode) { | 559 process.exitCode.then((int exitCode) { |
| 560 print('${arguments.join(" ")} exited with $exitCode'); | 560 print('${arguments.join(" ")} exited with $exitCode'); |
| 561 }); | 561 }); |
| 562 debuggerMain(); | 562 debuggerMain(); |
| 563 }); | 563 }); |
| 564 } else { | 564 } else { |
| 565 debuggerMain(); | 565 debuggerMain(); |
| 566 } | 566 } |
| 567 } | 567 } |
| OLD | NEW |