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