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:io"; | 10 import "dart:io"; |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 } | 421 } |
422 if (shutdownEventSeen) { | 422 if (shutdownEventSeen) { |
423 cleanup(); | 423 cleanup(); |
424 return; | 424 return; |
425 } | 425 } |
426 if (isPaused) sendNextCommand(); | 426 if (isPaused) sendNextCommand(); |
427 msg = responses.getNextMessage(); | 427 msg = responses.getNextMessage(); |
428 } | 428 } |
429 } | 429 } |
430 | 430 |
431 runScript(List entries) { | |
432 script = new DebugScript(entries); | |
433 openConnection(); | |
434 } | |
435 | |
436 // Send a debugger command to the target VM. | 431 // Send a debugger command to the target VM. |
437 void sendMessage(Map<String,dynamic> msg) { | 432 void sendMessage(Map<String,dynamic> msg) { |
438 if (msg["id"] != null) { | 433 if (msg["id"] != null) { |
439 msg["id"] = seqNr; | 434 msg["id"] = seqNr; |
440 } | 435 } |
441 if (msg["params"] != null && msg["params"]["isolateId"] != null) { | 436 if (msg["params"] != null && msg["params"]["isolateId"] != null) { |
442 msg["params"]["isolateId"] = isolateId; | 437 msg["params"]["isolateId"] = isolateId; |
443 } | 438 } |
444 String jsonMsg = JSON.stringify(msg); | 439 String jsonMsg = JSON.stringify(msg); |
445 if (verboseWire) print("SEND: $jsonMsg"); | 440 if (verboseWire) print("SEND: $jsonMsg"); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 targetOpts.add("--debuggee"); | 525 targetOpts.add("--debuggee"); |
531 print('args: ${targetOpts.join(" ")}'); | 526 print('args: ${targetOpts.join(" ")}'); |
532 | 527 |
533 Process.start(options.executable, targetOpts).then((Process process) { | 528 Process.start(options.executable, targetOpts).then((Process process) { |
534 print("Debug target process started, pid ${process.pid}."); | 529 print("Debug target process started, pid ${process.pid}."); |
535 process.stdin.close(); | 530 process.stdin.close(); |
536 var debugger = new Debugger(process, new DebugScript(script)); | 531 var debugger = new Debugger(process, new DebugScript(script)); |
537 }); | 532 }); |
538 return true; | 533 return true; |
539 } | 534 } |
OLD | NEW |