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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 }; | 549 }; |
550 } | 550 } |
551 | 551 |
552 void main() { | 552 void main() { |
553 Options options = new Options(); | 553 Options options = new Options(); |
554 List<String> arguments = options.arguments; | 554 List<String> arguments = options.arguments; |
555 if (arguments.length > 0) { | 555 if (arguments.length > 0) { |
556 arguments = <String>['--debug', '--verbose_debug']..addAll(arguments); | 556 arguments = <String>['--debug', '--verbose_debug']..addAll(arguments); |
557 Process.start(options.executable, arguments).then((Process process) { | 557 Process.start(options.executable, arguments).then((Process process) { |
558 process.onExit = (int exitCode) { | 558 process.onExit = (int exitCode) { |
559 print('${Strings.join(arguments, " ")} exited with $exitCode'); | 559 print('${arguments.join(" ")} exited with $exitCode'); |
560 }; | 560 }; |
561 process.stdin.close(); | 561 process.stdin.close(); |
562 // Redirecting both stdout and stderr of the child process to | 562 // Redirecting both stdout and stderr of the child process to |
563 // stdout. This should help users keep track of which errors | 563 // stdout. This should help users keep track of which errors |
564 // are coming from the debugger, and which errors are coming | 564 // are coming from the debugger, and which errors are coming |
565 // from the process being debugged. | 565 // from the process being debugged. |
566 process.stderr.pipe(stdout); | 566 process.stderr.pipe(stdout); |
567 process.stdout.pipe(stdout); | 567 process.stdout.pipe(stdout); |
568 debuggerMain(); | 568 debuggerMain(); |
569 }); | 569 }); |
570 } else { | 570 } else { |
571 debuggerMain(); | 571 debuggerMain(); |
572 } | 572 } |
573 } | 573 } |
OLD | NEW |