| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 debugger_page_element; | 5 library debugger_page_element; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
| 10 import 'package:observatory/app.dart'; | 10 import 'package:observatory/app.dart'; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 'activation of an async or async* function.\n' | 470 'activation of an async or async* function.\n' |
| 471 '\n' | 471 '\n' |
| 472 'Syntax: anext\n'; | 472 'Syntax: anext\n'; |
| 473 } | 473 } |
| 474 | 474 |
| 475 class FinishCommand extends DebuggerCommand { | 475 class FinishCommand extends DebuggerCommand { |
| 476 FinishCommand(Debugger debugger) : super(debugger, 'finish', []); | 476 FinishCommand(Debugger debugger) : super(debugger, 'finish', []); |
| 477 | 477 |
| 478 Future run(List<String> args) { | 478 Future run(List<String> args) { |
| 479 if (debugger.isolatePaused()) { | 479 if (debugger.isolatePaused()) { |
| 480 var event = debugger.isolate.pauseEvent; | |
| 481 if (event.kind == ServiceEvent.kPauseStart) { | |
| 482 debugger.console.print( | |
| 483 "Type 'continue' [F7] or 'step' [F10] to start the isolate"); | |
| 484 return new Future.value(null); | |
| 485 } | |
| 486 if (event.kind == ServiceEvent.kPauseExit) { | |
| 487 console.print("Type 'continue' [F7] to exit the isolate"); | |
| 488 return new Future.value(null); | |
| 489 } | |
| 490 return debugger.isolate.stepOut(); | 480 return debugger.isolate.stepOut(); |
| 491 } else { | 481 } else { |
| 492 debugger.console.print('The program is already running'); | 482 debugger.console.print('The program is already running'); |
| 493 return new Future.value(null); | 483 return new Future.value(null); |
| 494 } | 484 } |
| 495 } | 485 } |
| 496 | 486 |
| 497 String helpShort = | 487 String helpShort = |
| 498 'Continue running the isolate until the current function exits'; | 488 'Continue running the isolate until the current function exits'; |
| 499 | 489 |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 _reportPause(_isolate.pauseEvent); | 1332 _reportPause(_isolate.pauseEvent); |
| 1343 } else { | 1333 } else { |
| 1344 console.print('Isolate is in unknown state'); | 1334 console.print('Isolate is in unknown state'); |
| 1345 } | 1335 } |
| 1346 warnOutOfDate(); | 1336 warnOutOfDate(); |
| 1347 } | 1337 } |
| 1348 | 1338 |
| 1349 void _reportPause(ServiceEvent event) { | 1339 void _reportPause(ServiceEvent event) { |
| 1350 if (event.kind == ServiceEvent.kPauseStart) { | 1340 if (event.kind == ServiceEvent.kPauseStart) { |
| 1351 console.print( | 1341 console.print( |
| 1352 "Paused at isolate start (type 'continue' [F7] or 'step' [F10] to star
t the isolate')"); | 1342 "Paused at isolate start (type 'continue' or [F7] to start the isolate
')"); |
| 1353 } else if (event.kind == ServiceEvent.kPauseExit) { | 1343 } else if (event.kind == ServiceEvent.kPauseExit) { |
| 1354 console.print( | 1344 console.print( |
| 1355 "Paused at isolate exit (type 'continue' or [F7] to exit the isolate')
"); | 1345 "Paused at isolate exit (type 'continue' or [F7] to exit the isolate')
"); |
| 1356 } | 1346 } |
| 1357 if (stack['frames'].length > 0) { | 1347 if (stack['frames'].length > 0) { |
| 1358 Frame frame = stack['frames'][0]; | 1348 Frame frame = stack['frames'][0]; |
| 1359 var script = frame.location.script; | 1349 var script = frame.location.script; |
| 1360 script.load().then((_) { | 1350 script.load().then((_) { |
| 1361 var line = script.tokenToLine(frame.location.tokenPos); | 1351 var line = script.tokenToLine(frame.location.tokenPos); |
| 1362 var col = script.tokenToCol(frame.location.tokenPos); | 1352 var col = script.tokenToCol(frame.location.tokenPos); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 await Future.wait(pending); | 1605 await Future.wait(pending); |
| 1616 } | 1606 } |
| 1617 } | 1607 } |
| 1618 return new Future.value(null); | 1608 return new Future.value(null); |
| 1619 } | 1609 } |
| 1620 | 1610 |
| 1621 Future next() { | 1611 Future next() { |
| 1622 if (isolatePaused()) { | 1612 if (isolatePaused()) { |
| 1623 var event = isolate.pauseEvent; | 1613 var event = isolate.pauseEvent; |
| 1624 if (event.kind == ServiceEvent.kPauseStart) { | 1614 if (event.kind == ServiceEvent.kPauseStart) { |
| 1625 console.print("Type 'continue' [F7] or 'step' [F10] to start the isolate
"); | 1615 console.print("Type 'continue' or [F7] to start the isolate"); |
| 1626 return new Future.value(null); | 1616 return new Future.value(null); |
| 1627 } | 1617 } |
| 1628 if (event.kind == ServiceEvent.kPauseExit) { | 1618 if (event.kind == ServiceEvent.kPauseExit) { |
| 1629 console.print("Type 'continue' [F7] to exit the isolate"); | 1619 console.print("Type 'continue' or [F7] to exit the isolate"); |
| 1630 return new Future.value(null); | 1620 return new Future.value(null); |
| 1631 } | 1621 } |
| 1632 return isolate.stepOver(); | 1622 return isolate.stepOver(); |
| 1633 } else { | 1623 } else { |
| 1634 console.print('The program is already running'); | 1624 console.print('The program is already running'); |
| 1635 return new Future.value(null); | 1625 return new Future.value(null); |
| 1636 } | 1626 } |
| 1637 } | 1627 } |
| 1638 | 1628 |
| 1639 Future step() { | 1629 Future step() { |
| 1640 if (isolatePaused()) { | 1630 if (isolatePaused()) { |
| 1641 var event = isolate.pauseEvent; | 1631 var event = isolate.pauseEvent; |
| 1632 if (event.kind == ServiceEvent.kPauseStart) { |
| 1633 console.print("Type 'continue' or [F7] to start the isolate"); |
| 1634 return new Future.value(null); |
| 1635 } |
| 1642 if (event.kind == ServiceEvent.kPauseExit) { | 1636 if (event.kind == ServiceEvent.kPauseExit) { |
| 1643 console.print("Type 'continue' [F7] to exit the isolate"); | 1637 console.print("Type 'continue' or [F7] to exit the isolate"); |
| 1644 return new Future.value(null); | 1638 return new Future.value(null); |
| 1645 } | 1639 } |
| 1646 return isolate.stepInto(); | 1640 return isolate.stepInto(); |
| 1647 } else { | 1641 } else { |
| 1648 console.print('The program is already running'); | 1642 console.print('The program is already running'); |
| 1649 return new Future.value(null); | 1643 return new Future.value(null); |
| 1650 } | 1644 } |
| 1651 } | 1645 } |
| 1652 } | 1646 } |
| 1653 | 1647 |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 } | 2299 } |
| 2306 }); | 2300 }); |
| 2307 } | 2301 } |
| 2308 | 2302 |
| 2309 void focus() { | 2303 void focus() { |
| 2310 $['textBox'].focus(); | 2304 $['textBox'].focus(); |
| 2311 } | 2305 } |
| 2312 | 2306 |
| 2313 DebuggerInputElement.created() : super.created(); | 2307 DebuggerInputElement.created() : super.created(); |
| 2314 } | 2308 } |
| OLD | NEW |