| OLD | NEW |
| 1 // Copyright (c) 2012, 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:io"; | 9 import "dart:io"; |
| 10 import "dart:utf"; | 10 import "dart:utf"; |
| 11 import "dart:json" as JSON; | 11 import "dart:json" as JSON; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 453 |
| 454 runScript(List entries) { | 454 runScript(List entries) { |
| 455 script = new DebugScript(entries); | 455 script = new DebugScript(entries); |
| 456 openConnection(); | 456 openConnection(); |
| 457 } | 457 } |
| 458 | 458 |
| 459 // Send a debugger command to the target VM. | 459 // Send a debugger command to the target VM. |
| 460 void sendMessage(Map<String,dynamic> msg) { | 460 void sendMessage(Map<String,dynamic> msg) { |
| 461 String jsonMsg = JSON.stringify(msg); | 461 String jsonMsg = JSON.stringify(msg); |
| 462 if (verboseWire) print("SEND: $jsonMsg"); | 462 if (verboseWire) print("SEND: $jsonMsg"); |
| 463 socket.addString(jsonMsg); | 463 socket.write(jsonMsg); |
| 464 } | 464 } |
| 465 | 465 |
| 466 bool get errorsDetected => errors.length > 0; | 466 bool get errorsDetected => errors.length > 0; |
| 467 | 467 |
| 468 // Record error message. | 468 // Record error message. |
| 469 void error(String s) { | 469 void error(String s) { |
| 470 errors.add(s); | 470 errors.add(s); |
| 471 } | 471 } |
| 472 | 472 |
| 473 void openConnection() { | 473 void openConnection() { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 process.exitCode.then((int exitCode) { | 532 process.exitCode.then((int exitCode) { |
| 533 Expect.equals(0, exitCode); | 533 Expect.equals(0, exitCode); |
| 534 Expect.equals(0, exitCode); | 534 Expect.equals(0, exitCode); |
| 535 print("Debug target process exited with exit code $exitCode"); | 535 print("Debug target process exited with exit code $exitCode"); |
| 536 }); | 536 }); |
| 537 var debugger = new Debugger(process, debugPort); | 537 var debugger = new Debugger(process, debugPort); |
| 538 debugger.runScript(script); | 538 debugger.runScript(script); |
| 539 }); | 539 }); |
| 540 return true; | 540 return true; |
| 541 } | 541 } |
| OLD | NEW |