| Index: dart/tools/ddbg.dart
|
| diff --git a/dart/tools/ddbg.dart b/dart/tools/ddbg.dart
|
| index eaf0258a85f979918ea8fe8cd6595f4997207707..8af5714559008d11326344d91e0fbcd3bf90da01 100644
|
| --- a/dart/tools/ddbg.dart
|
| +++ b/dart/tools/ddbg.dart
|
| @@ -526,7 +526,7 @@ int jsonObjectLength(String string) {
|
| }
|
|
|
|
|
| -void main() {
|
| +void debuggerMain() {
|
| outstandingCommands = new Map<int, Completer>();
|
| vmSock = new Socket("127.0.0.1", 5858);
|
| vmStream = new SocketOutputStream(vmSock);
|
| @@ -548,3 +548,26 @@ void main() {
|
| quitShell();
|
| };
|
| }
|
| +
|
| +void main() {
|
| + Options options = new Options();
|
| + List<String> arguments = options.arguments;
|
| + if (arguments.length > 0) {
|
| + arguments = <String>['--debug', '--verbose_debug']..addAll(arguments);
|
| + Process.start(options.executable, arguments).then((Process process) {
|
| + process.onExit = (int exitCode) {
|
| + print('${Strings.join(arguments, " ")} exited with $exitCode');
|
| + };
|
| + process.stdin.close();
|
| + // Redirecting both stdout and stderr of the child process to
|
| + // stdout. This should help users keep track of which errors
|
| + // are coming from the debugger, and which errors are coming
|
| + // from the process being debugged.
|
| + process.stderr.pipe(stdout);
|
| + process.stdout.pipe(stdout);
|
| + debuggerMain();
|
| + });
|
| + } else {
|
| + debuggerMain();
|
| + }
|
| +}
|
|
|