| 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/cli.dart'; | 10 import 'package:observatory/cli.dart'; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 AsyncNextCommand(Debugger debugger) : super(debugger, 'anext', []) { | 353 AsyncNextCommand(Debugger debugger) : super(debugger, 'anext', []) { |
| 354 } | 354 } |
| 355 | 355 |
| 356 Future run(List<String> args) async { | 356 Future run(List<String> args) async { |
| 357 if (debugger.isolatePaused()) { | 357 if (debugger.isolatePaused()) { |
| 358 var event = debugger.isolate.pauseEvent; | 358 var event = debugger.isolate.pauseEvent; |
| 359 if (event.asyncContinuation == null) { | 359 if (event.asyncContinuation == null) { |
| 360 debugger.console.print("No async continuation at this location"); | 360 debugger.console.print("No async continuation at this location"); |
| 361 return; | 361 return; |
| 362 } | 362 } |
| 363 var bpt = await | 363 return debugger.isolate.asyncStepOver()[0]; |
| 364 debugger.isolate.addBreakOnActivation(event.asyncContinuation); | |
| 365 return debugger.isolate.resume(); | |
| 366 } else { | 364 } else { |
| 367 debugger.console.print('The program is already running'); | 365 debugger.console.print('The program is already running'); |
| 368 } | 366 } |
| 369 } | 367 } |
| 370 | 368 |
| 371 String helpShort = | 369 String helpShort = |
| 372 'Step over await or yield'; | 370 'Step over await or yield'; |
| 373 | 371 |
| 374 String helpLong = | 372 String helpLong = |
| 375 'Continue running the isolate until control returns to the current ' | 373 'Continue running the isolate until control returns to the current ' |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 new RefreshCommand(this), | 988 new RefreshCommand(this), |
| 991 ]); | 989 ]); |
| 992 _stdioPrinter = new _VMStreamPrinter(this); | 990 _stdioPrinter = new _VMStreamPrinter(this); |
| 993 } | 991 } |
| 994 | 992 |
| 995 VM get vm => page.app.vm; | 993 VM get vm => page.app.vm; |
| 996 | 994 |
| 997 void updateIsolate(Isolate iso) { | 995 void updateIsolate(Isolate iso) { |
| 998 _isolate = iso; | 996 _isolate = iso; |
| 999 if (_isolate != null) { | 997 if (_isolate != null) { |
| 1000 if (exceptions != iso.exceptionsPauseInfo) { | 998 if ((exceptions != iso.exceptionsPauseInfo) && |
| 999 (iso.exceptionsPauseInfo != null)) { |
| 1001 exceptions = iso.exceptionsPauseInfo; | 1000 exceptions = iso.exceptionsPauseInfo; |
| 1002 console.print("Now pausing for $exceptions exceptions"); | 1001 console.print("Now pausing for $exceptions exceptions"); |
| 1003 } | 1002 } |
| 1004 | 1003 |
| 1005 _isolate.reload().then((response) { | 1004 _isolate.reload().then((response) { |
| 1006 // TODO(turnidge): Currently the debugger relies on all libs | 1005 // TODO(turnidge): Currently the debugger relies on all libs |
| 1007 // being loaded. Fix this. | 1006 // being loaded. Fix this. |
| 1008 var pending = []; | 1007 var pending = []; |
| 1009 for (var lib in _isolate.libraries) { | 1008 for (var lib in _isolate.libraries) { |
| 1010 if (!lib.loaded) { | 1009 if (!lib.loaded) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 console.print('Paused due to exception at ' | 1125 console.print('Paused due to exception at ' |
| 1127 '${script.name}:${line}:${col}'); | 1126 '${script.name}:${line}:${col}'); |
| 1128 // This seems to be missing if we are paused-at-exception after | 1127 // This seems to be missing if we are paused-at-exception after |
| 1129 // paused-at-isolate-exit. Maybe we shutdown part of the debugger too | 1128 // paused-at-isolate-exit. Maybe we shutdown part of the debugger too |
| 1130 // soon? | 1129 // soon? |
| 1131 console.printRef(event.exception); | 1130 console.printRef(event.exception); |
| 1132 } else { | 1131 } else { |
| 1133 console.print('Paused at ${script.name}:${line}:${col}'); | 1132 console.print('Paused at ${script.name}:${line}:${col}'); |
| 1134 } | 1133 } |
| 1135 if (event.asyncContinuation != null) { | 1134 if (event.asyncContinuation != null) { |
| 1136 console.print("Paused in async function: 'astep' available"); | 1135 console.print("Paused in async function: 'anext' available"); |
| 1137 } | 1136 } |
| 1138 }); | 1137 }); |
| 1139 } | 1138 } |
| 1140 } | 1139 } |
| 1141 | 1140 |
| 1142 Future _reportBreakpointEvent(ServiceEvent event) { | 1141 Future _reportBreakpointEvent(ServiceEvent event) { |
| 1143 var bpt = event.breakpoint; | 1142 var bpt = event.breakpoint; |
| 1144 var verb = null; | 1143 var verb = null; |
| 1145 switch (event.kind) { | 1144 switch (event.kind) { |
| 1146 case ServiceEvent.kBreakpointAdded: | 1145 case ServiceEvent.kBreakpointAdded: |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1884 }); | 1883 }); |
| 1885 } | 1884 } |
| 1886 | 1885 |
| 1887 void focus() { | 1886 void focus() { |
| 1888 $['textBox'].focus(); | 1887 $['textBox'].focus(); |
| 1889 } | 1888 } |
| 1890 | 1889 |
| 1891 DebuggerInputElement.created() : super.created(); | 1890 DebuggerInputElement.created() : super.created(); |
| 1892 } | 1891 } |
| 1893 | 1892 |
| OLD | NEW |