| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Library used by debugger wire protocol tests (standalone VM debugging). | 5 // Library used by debugger wire protocol tests (standalone VM debugging). |
| 6 | 6 |
| 7 library DartDebugger; | 7 library DartDebugger; |
| 8 | 8 |
| 9 import "dart:async"; | 9 import "dart:async"; |
| 10 import "dart:convert"; | 10 import "dart:convert"; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 | 600 |
| 601 | 601 |
| 602 bool RunScript(List script, List<String> arguments) { | 602 bool RunScript(List script, List<String> arguments) { |
| 603 if (arguments.contains("--debuggee")) { | 603 if (arguments.contains("--debuggee")) { |
| 604 return false; | 604 return false; |
| 605 } | 605 } |
| 606 verboseWire = arguments.contains("--wire"); | 606 verboseWire = arguments.contains("--wire"); |
| 607 | 607 |
| 608 // Port number 0 means debug target picks a free port dynamically. | 608 // Port number 0 means debug target picks a free port dynamically. |
| 609 var targetOpts = [ "--debug:0" ]; | 609 var targetOpts = [ "--debug:0" ]; |
| 610 targetOpts.add(Platform.script); | 610 targetOpts.add(Platform.script.toFilePath()); |
| 611 targetOpts.add("--debuggee"); | 611 targetOpts.add("--debuggee"); |
| 612 print('args: ${targetOpts.join(" ")}'); | 612 print('args: ${targetOpts.join(" ")}'); |
| 613 | 613 |
| 614 Process.start(Platform.executable, targetOpts).then((Process process) { | 614 Process.start(Platform.executable, targetOpts).then((Process process) { |
| 615 print("Debug target process started, pid ${process.pid}."); | 615 print("Debug target process started, pid ${process.pid}."); |
| 616 process.stdin.close(); | 616 process.stdin.close(); |
| 617 var debugger = new Debugger(process, new DebugScript(script)); | 617 var debugger = new Debugger(process, new DebugScript(script)); |
| 618 }); | 618 }); |
| 619 return true; | 619 return true; |
| 620 } | 620 } |
| OLD | NEW |