| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 assert(isolateId != null); | 334 assert(isolateId != null); |
| 335 print("Debuggee isolate id $isolateId created."); | 335 print("Debuggee isolate id $isolateId created."); |
| 336 } else if (msg["params"]["reason"] == "shutdown") { | 336 } else if (msg["params"]["reason"] == "shutdown") { |
| 337 print("Debuggee isolate id ${msg["params"]["id"]} shut down."); | 337 print("Debuggee isolate id ${msg["params"]["id"]} shut down."); |
| 338 shutdownEventSeen = true; | 338 shutdownEventSeen = true; |
| 339 if (!script.isEmpty) { | 339 if (!script.isEmpty) { |
| 340 error("Premature isolate shutdown event seen."); | 340 error("Premature isolate shutdown event seen."); |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 } else if (msg["event"] == "breakpointResolved") { | 343 } else if (msg["event"] == "breakpointResolved") { |
| 344 // Ignore the event. We may want to maintain a table of | 344 var bpId = msg["params"]["breakpointId"]; |
| 345 // breakpoints in the future. | 345 assert(bpId != null); |
| 346 var isolateId = msg["params"]["isolateId"]; |
| 347 assert(isolateId != null); |
| 348 var location = msg["params"]["location"]; |
| 349 assert(location != null); |
| 350 print("Isolate $isolateId: breakpoint $bpId resolved" |
| 351 " at location $location"); |
| 352 // We may want to maintain a table of breakpoints in the future. |
| 346 } else if (msg["event"] == "paused") { | 353 } else if (msg["event"] == "paused") { |
| 347 isPaused = true; | 354 isPaused = true; |
| 348 } else { | 355 } else { |
| 349 error("unknown debugger event received"); | 356 error("unknown debugger event received"); |
| 350 } | 357 } |
| 351 } | 358 } |
| 352 | 359 |
| 353 // Handle one JSON message object and match it to the | 360 // Handle one JSON message object and match it to the |
| 354 // expected events and responses in the debugging script. | 361 // expected events and responses in the debugging script. |
| 355 void handleMessage(Map<String,dynamic> receivedMsg) { | 362 void handleMessage(Map<String,dynamic> receivedMsg) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 var trace = getAttachedStackTrace(e); | 534 var trace = getAttachedStackTrace(e); |
| 528 if (trace != null) print("StackTrace: $trace"); | 535 if (trace != null) print("StackTrace: $trace"); |
| 529 return -1; | 536 return -1; |
| 530 } else { | 537 } else { |
| 531 // Retry with another random port. | 538 // Retry with another random port. |
| 532 RunScript(script); | 539 RunScript(script); |
| 533 } | 540 } |
| 534 }); | 541 }); |
| 535 return true; | 542 return true; |
| 536 } | 543 } |
| OLD | NEW |