| 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'; |
| 11 import 'package:observatory/debugger.dart'; | 11 import 'package:observatory/debugger.dart'; |
| 12 import 'package:observatory/service.dart'; | 12 import 'package:observatory/service.dart'; |
| 13 import 'package:logging/logging.dart'; |
| 13 import 'package:polymer/polymer.dart'; | 14 import 'package:polymer/polymer.dart'; |
| 14 | 15 |
| 15 // TODO(turnidge): Move Debugger, DebuggerCommand to debugger library. | 16 // TODO(turnidge): Move Debugger, DebuggerCommand to debugger library. |
| 16 abstract class DebuggerCommand extends Command { | 17 abstract class DebuggerCommand extends Command { |
| 17 ObservatoryDebugger debugger; | 18 ObservatoryDebugger debugger; |
| 18 | 19 |
| 19 DebuggerCommand(this.debugger, name, children) | 20 DebuggerCommand(this.debugger, name, children) |
| 20 : super(name, children); | 21 : super(name, children); |
| 21 | 22 |
| 22 String get helpShort; | 23 String get helpShort; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 String helpShort = | 343 String helpShort = |
| 343 'Continue running the isolate until it reaches the next source location'; | 344 'Continue running the isolate until it reaches the next source location'; |
| 344 | 345 |
| 345 String helpLong = | 346 String helpLong = |
| 346 'Continue running the isolate until it reaches the next source ' | 347 'Continue running the isolate until it reaches the next source ' |
| 347 'location.\n' | 348 'location.\n' |
| 348 '\n' | 349 '\n' |
| 349 'Syntax: step\n'; | 350 'Syntax: step\n'; |
| 350 } | 351 } |
| 351 | 352 |
| 353 class LogCommand extends DebuggerCommand { |
| 354 LogCommand(Debugger debugger) : super(debugger, 'log', []); |
| 355 |
| 356 Future run(List<String> args) async { |
| 357 if (args.length == 0) { |
| 358 debugger.console.print( |
| 359 'Current log level: ' |
| 360 '${debugger._consolePrinter._minimumLogLevel.name}'); |
| 361 return new Future.value(null); |
| 362 } |
| 363 if (args.length > 1) { |
| 364 debugger.console.print("log expects zero or one arguments"); |
| 365 return new Future.value(null); |
| 366 } |
| 367 var level = _findLevel(args[0]); |
| 368 if (level == null) { |
| 369 debugger.console.print('No such log level: ${args[0]}'); |
| 370 return new Future.value(null); |
| 371 } |
| 372 debugger._consolePrinter._minimumLogLevel = level; |
| 373 debugger.console.print('Set log level to: ${level.name}'); |
| 374 return new Future.value(null); |
| 375 } |
| 376 |
| 377 Level _findLevel(String levelName) { |
| 378 levelName = levelName.toUpperCase(); |
| 379 for (var level in Level.LEVELS) { |
| 380 if (level.name == levelName) { |
| 381 return level; |
| 382 } |
| 383 } |
| 384 return null; |
| 385 } |
| 386 |
| 387 Future<List<String>> complete(List<String> args) { |
| 388 if (args.length != 1) { |
| 389 return new Future.value([args.join('')]); |
| 390 } |
| 391 var prefix = args[0].toUpperCase(); |
| 392 var result = <String>[]; |
| 393 for (var level in Level.LEVELS) { |
| 394 if (level.name.startsWith(prefix)) { |
| 395 result.add(level.name); |
| 396 } |
| 397 } |
| 398 return new Future.value(result); |
| 399 } |
| 400 |
| 401 String helpShort = |
| 402 'Control which log messages are displayed'; |
| 403 |
| 404 String helpLong = |
| 405 'Get or set the minimum log level that should be displayed.\n' |
| 406 '\n' |
| 407 'Log levels (in ascending order): ALL, FINEST, FINER, FINE, CONFIG, ' |
| 408 'INFO, WARNING, SEVERE, SHOUT, OFF\n' |
| 409 '\n' |
| 410 'Default: OFF\n' |
| 411 '\n' |
| 412 'Syntax: log ' |
| 413 '# Display the current minimum log level.\n' |
| 414 ' log <level> ' |
| 415 '# Set the minimum log level to <level>.\n' |
| 416 ' log OFF ' |
| 417 '# Display no log messages.\n' |
| 418 ' log ALL ' |
| 419 '# Display all log messages.\n'; |
| 420 } |
| 421 |
| 352 class AsyncNextCommand extends DebuggerCommand { | 422 class AsyncNextCommand extends DebuggerCommand { |
| 353 AsyncNextCommand(Debugger debugger) : super(debugger, 'anext', []) { | 423 AsyncNextCommand(Debugger debugger) : super(debugger, 'anext', []) { |
| 354 } | 424 } |
| 355 | 425 |
| 356 Future run(List<String> args) async { | 426 Future run(List<String> args) async { |
| 357 if (debugger.isolatePaused()) { | 427 if (debugger.isolatePaused()) { |
| 358 var event = debugger.isolate.pauseEvent; | 428 var event = debugger.isolate.pauseEvent; |
| 359 if (event.asyncContinuation == null) { | 429 if (event.asyncContinuation == null) { |
| 360 debugger.console.print("No async continuation at this location"); | 430 debugger.console.print("No async continuation at this location"); |
| 361 } else { | 431 } else { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // TODO - fix DebuggerLocation complete | 547 // TODO - fix DebuggerLocation complete |
| 478 return new Future.value(DebuggerLocation.complete(debugger, args[0])); | 548 return new Future.value(DebuggerLocation.complete(debugger, args[0])); |
| 479 } | 549 } |
| 480 | 550 |
| 481 String helpShort = 'Add a breakpoint by source location or function name'; | 551 String helpShort = 'Add a breakpoint by source location or function name'; |
| 482 | 552 |
| 483 String helpLong = | 553 String helpLong = |
| 484 'Add a breakpoint by source location or function name.\n' | 554 'Add a breakpoint by source location or function name.\n' |
| 485 '\n' | 555 '\n' |
| 486 'Syntax: break ' | 556 'Syntax: break ' |
| 487 '- Break at the current position\n' | 557 '# Break at the current position\n' |
| 488 ' break <line> ' | 558 ' break <line> ' |
| 489 '- Break at a line in the current script\n' | 559 '# Break at a line in the current script\n' |
| 490 ' ' | 560 ' ' |
| 491 ' (e.g \'break 11\')\n' | 561 ' (e.g \'break 11\')\n' |
| 492 ' break <line>:<col> ' | 562 ' break <line>:<col> ' |
| 493 '- Break at a line:col in the current script\n' | 563 '# Break at a line:col in the current script\n' |
| 494 ' ' | 564 ' ' |
| 495 ' (e.g \'break 11:8\')\n' | 565 ' (e.g \'break 11:8\')\n' |
| 496 ' break <script>:<line> ' | 566 ' break <script>:<line> ' |
| 497 '- Break at a line:col in a specific script\n' | 567 '# Break at a line:col in a specific script\n' |
| 498 ' ' | 568 ' ' |
| 499 ' (e.g \'break test.dart:11\')\n' | 569 ' (e.g \'break test.dart:11\')\n' |
| 500 ' break <script>:<line>:<col> ' | 570 ' break <script>:<line>:<col> ' |
| 501 '- Break at a line:col in a specific script\n' | 571 '# Break at a line:col in a specific script\n' |
| 502 ' ' | 572 ' ' |
| 503 ' (e.g \'break test.dart:11:8\')\n' | 573 ' (e.g \'break test.dart:11:8\')\n' |
| 504 ' break <function> ' | 574 ' break <function> ' |
| 505 '- Break at the named function\n' | 575 '# Break at the named function\n' |
| 506 ' ' | 576 ' ' |
| 507 ' (e.g \'break main\' or \'break Class.someFunction\')\n'; | 577 ' (e.g \'break main\' or \'break Class.someFunction\')\n'; |
| 508 } | 578 } |
| 509 | 579 |
| 510 class ClearCommand extends DebuggerCommand { | 580 class ClearCommand extends DebuggerCommand { |
| 511 ClearCommand(Debugger debugger) : super(debugger, 'clear', []); | 581 ClearCommand(Debugger debugger) : super(debugger, 'clear', []); |
| 512 | 582 |
| 513 Future run(List<String> args) { | 583 Future run(List<String> args) { |
| 514 if (args.length > 1) { | 584 if (args.length > 1) { |
| 515 debugger.console.print('not implemented'); | 585 debugger.console.print('not implemented'); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 630 } |
| 561 return new Future.value(DebuggerLocation.complete(debugger, args[0])); | 631 return new Future.value(DebuggerLocation.complete(debugger, args[0])); |
| 562 } | 632 } |
| 563 | 633 |
| 564 String helpShort = 'Remove a breakpoint by source location or function name'; | 634 String helpShort = 'Remove a breakpoint by source location or function name'; |
| 565 | 635 |
| 566 String helpLong = | 636 String helpLong = |
| 567 'Remove a breakpoint by source location or function name.\n' | 637 'Remove a breakpoint by source location or function name.\n' |
| 568 '\n' | 638 '\n' |
| 569 'Syntax: clear ' | 639 'Syntax: clear ' |
| 570 '- Clear at the current position\n' | 640 '# Clear at the current position\n' |
| 571 ' clear <line> ' | 641 ' clear <line> ' |
| 572 '- Clear at a line in the current script\n' | 642 '# Clear at a line in the current script\n' |
| 573 ' ' | 643 ' ' |
| 574 ' (e.g \'clear 11\')\n' | 644 ' (e.g \'clear 11\')\n' |
| 575 ' clear <line>:<col> ' | 645 ' clear <line>:<col> ' |
| 576 '- Clear at a line:col in the current script\n' | 646 '# Clear at a line:col in the current script\n' |
| 577 ' ' | 647 ' ' |
| 578 ' (e.g \'clear 11:8\')\n' | 648 ' (e.g \'clear 11:8\')\n' |
| 579 ' clear <script>:<line> ' | 649 ' clear <script>:<line> ' |
| 580 '- Clear at a line:col in a specific script\n' | 650 '# Clear at a line:col in a specific script\n' |
| 581 ' ' | 651 ' ' |
| 582 ' (e.g \'clear test.dart:11\')\n' | 652 ' (e.g \'clear test.dart:11\')\n' |
| 583 ' clear <script>:<line>:<col> ' | 653 ' clear <script>:<line>:<col> ' |
| 584 '- Clear at a line:col in a specific script\n' | 654 '# Clear at a line:col in a specific script\n' |
| 585 ' ' | 655 ' ' |
| 586 ' (e.g \'clear test.dart:11:8\')\n' | 656 ' (e.g \'clear test.dart:11:8\')\n' |
| 587 ' clear <function> ' | 657 ' clear <function> ' |
| 588 '- Clear at the named function\n' | 658 '# Clear at the named function\n' |
| 589 ' ' | 659 ' ' |
| 590 ' (e.g \'clear main\' or \'clear Class.someFunction\')\n'; | 660 ' (e.g \'clear main\' or \'clear Class.someFunction\')\n'; |
| 591 } | 661 } |
| 592 | 662 |
| 593 // TODO(turnidge): Add argument completion. | 663 // TODO(turnidge): Add argument completion. |
| 594 class DeleteCommand extends DebuggerCommand { | 664 class DeleteCommand extends DebuggerCommand { |
| 595 DeleteCommand(Debugger debugger) : super(debugger, 'delete', []); | 665 DeleteCommand(Debugger debugger) : super(debugger, 'delete', []); |
| 596 | 666 |
| 597 Future run(List<String> args) { | 667 Future run(List<String> args) { |
| 598 if (args.length < 1) { | 668 if (args.length < 1) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 } | 944 } |
| 875 | 945 |
| 876 String helpShort = 'Refresh debugging information of various sorts'; | 946 String helpShort = 'Refresh debugging information of various sorts'; |
| 877 | 947 |
| 878 String helpLong = | 948 String helpLong = |
| 879 'Refresh debugging information of various sorts.\n' | 949 'Refresh debugging information of various sorts.\n' |
| 880 '\n' | 950 '\n' |
| 881 'Syntax: refresh <subcommand>\n'; | 951 'Syntax: refresh <subcommand>\n'; |
| 882 } | 952 } |
| 883 | 953 |
| 884 class _VMStreamPrinter { | 954 class _ConsoleStreamPrinter { |
| 885 ObservatoryDebugger _debugger; | 955 ObservatoryDebugger _debugger; |
| 886 | 956 |
| 887 _VMStreamPrinter(this._debugger); | 957 _ConsoleStreamPrinter(this._debugger); |
| 888 | 958 Level _minimumLogLevel = Level.OFF; |
| 889 String _savedStream; | 959 String _savedStream; |
| 890 String _savedIsolate; | 960 String _savedIsolate; |
| 891 String _savedLine; | 961 String _savedLine; |
| 892 List<String> _buffer = []; | 962 List<String> _buffer = []; |
| 893 | 963 |
| 894 void onEvent(String streamName, ServiceEvent event) { | 964 void onEvent(String streamName, ServiceEvent event) { |
| 965 if (event.kind == ServiceEvent.kLogging) { |
| 966 // Check if we should print this log message. |
| 967 if (event.logRecord['level'].value < _minimumLogLevel.value) { |
| 968 return; |
| 969 } |
| 970 } |
| 895 String isolateName = event.isolate.name; | 971 String isolateName = event.isolate.name; |
| 896 // If we get a line from a different isolate/stream, flush | 972 // If we get a line from a different isolate/stream, flush |
| 897 // any pending output, even if it is not newline-terminated. | 973 // any pending output, even if it is not newline-terminated. |
| 898 if ((_savedIsolate != null && isolateName != _savedIsolate) || | 974 if ((_savedIsolate != null && isolateName != _savedIsolate) || |
| 899 (_savedStream != null && streamName != _savedStream)) { | 975 (_savedStream != null && streamName != _savedStream)) { |
| 900 flush(); | 976 flush(); |
| 901 } | 977 } |
| 902 String data = event.bytesAsString; | 978 String data; |
| 903 bool hasNewline = data.endsWith('\n'); | 979 bool hasNewline; |
| 980 if (event.kind == ServiceEvent.kLogging) { |
| 981 data = event.logRecord["message"].valueAsString; |
| 982 hasNewline = true; |
| 983 } else { |
| 984 data = event.bytesAsString; |
| 985 hasNewline = data.endsWith('\n'); |
| 986 } |
| 904 if (_savedLine != null) { | 987 if (_savedLine != null) { |
| 905 data = _savedLine + data; | 988 data = _savedLine + data; |
| 906 _savedIsolate = null; | 989 _savedIsolate = null; |
| 907 _savedStream = null; | 990 _savedStream = null; |
| 908 _savedLine = null; | 991 _savedLine = null; |
| 909 } | 992 } |
| 910 var lines = data.split('\n').where((line) => line != '').toList(); | 993 var lines = data.split('\n').where((line) => line != '').toList(); |
| 911 if (lines.isEmpty) { | 994 if (lines.isEmpty) { |
| 912 return; | 995 return; |
| 913 } | 996 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 new StepCommand(this), | 1062 new StepCommand(this), |
| 980 new AsyncNextCommand(this), | 1063 new AsyncNextCommand(this), |
| 981 new FinishCommand(this), | 1064 new FinishCommand(this), |
| 982 new BreakCommand(this), | 1065 new BreakCommand(this), |
| 983 new SetCommand(this), | 1066 new SetCommand(this), |
| 984 new ClearCommand(this), | 1067 new ClearCommand(this), |
| 985 new DeleteCommand(this), | 1068 new DeleteCommand(this), |
| 986 new InfoCommand(this), | 1069 new InfoCommand(this), |
| 987 new IsolateCommand(this), | 1070 new IsolateCommand(this), |
| 988 new RefreshCommand(this), | 1071 new RefreshCommand(this), |
| 1072 new LogCommand(this), |
| 989 ]); | 1073 ]); |
| 990 _stdioPrinter = new _VMStreamPrinter(this); | 1074 _consolePrinter = new _ConsoleStreamPrinter(this); |
| 991 } | 1075 } |
| 992 | 1076 |
| 993 VM get vm => page.app.vm; | 1077 VM get vm => page.app.vm; |
| 994 | 1078 |
| 995 void updateIsolate(Isolate iso) { | 1079 void updateIsolate(Isolate iso) { |
| 996 _isolate = iso; | 1080 _isolate = iso; |
| 997 if (_isolate != null) { | 1081 if (_isolate != null) { |
| 998 if ((exceptions != iso.exceptionsPauseInfo) && | 1082 if ((exceptions != iso.exceptionsPauseInfo) && |
| 999 (iso.exceptionsPauseInfo != null)) { | 1083 (iso.exceptionsPauseInfo != null)) { |
| 1000 exceptions = iso.exceptionsPauseInfo; | 1084 exceptions = iso.exceptionsPauseInfo; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 _reportBreakpointEvent(event); | 1315 _reportBreakpointEvent(event); |
| 1232 } | 1316 } |
| 1233 break; | 1317 break; |
| 1234 | 1318 |
| 1235 case ServiceEvent.kIsolateStart: | 1319 case ServiceEvent.kIsolateStart: |
| 1236 case ServiceEvent.kGraph: | 1320 case ServiceEvent.kGraph: |
| 1237 case ServiceEvent.kGC: | 1321 case ServiceEvent.kGC: |
| 1238 case ServiceEvent.kInspect: | 1322 case ServiceEvent.kInspect: |
| 1239 break; | 1323 break; |
| 1240 | 1324 |
| 1325 case ServiceEvent.kLogging: |
| 1326 _consolePrinter.onEvent(event.logRecord['level'].name, event); |
| 1327 break; |
| 1328 |
| 1241 default: | 1329 default: |
| 1242 console.print('Unrecognized event: $event'); | 1330 console.print('Unrecognized event: $event'); |
| 1243 break; | 1331 break; |
| 1244 } | 1332 } |
| 1245 } | 1333 } |
| 1246 | 1334 |
| 1247 _VMStreamPrinter _stdioPrinter; | 1335 _ConsoleStreamPrinter _consolePrinter; |
| 1248 | 1336 |
| 1249 void flushStdio() { | 1337 void flushStdio() { |
| 1250 _stdioPrinter.flush(); | 1338 _consolePrinter.flush(); |
| 1251 } | 1339 } |
| 1252 | 1340 |
| 1253 void onStdout(ServiceEvent event) { | 1341 void onStdout(ServiceEvent event) { |
| 1254 _stdioPrinter.onEvent('stdout', event); | 1342 _consolePrinter.onEvent('stdout', event); |
| 1255 } | 1343 } |
| 1256 | 1344 |
| 1257 void onStderr(ServiceEvent event) { | 1345 void onStderr(ServiceEvent event) { |
| 1258 _stdioPrinter.onEvent('stderr', event); | 1346 _consolePrinter.onEvent('stderr', event); |
| 1259 } | 1347 } |
| 1260 | 1348 |
| 1261 static String _commonPrefix(String a, String b) { | 1349 static String _commonPrefix(String a, String b) { |
| 1262 int pos = 0; | 1350 int pos = 0; |
| 1263 while (pos < a.length && pos < b.length) { | 1351 while (pos < a.length && pos < b.length) { |
| 1264 if (a.codeUnitAt(pos) != b.codeUnitAt(pos)) { | 1352 if (a.codeUnitAt(pos) != b.codeUnitAt(pos)) { |
| 1265 break; | 1353 break; |
| 1266 } | 1354 } |
| 1267 pos++; | 1355 pos++; |
| 1268 } | 1356 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 ObservatoryDebugger debugger = new ObservatoryDebugger(); | 1430 ObservatoryDebugger debugger = new ObservatoryDebugger(); |
| 1343 | 1431 |
| 1344 DebuggerPageElement.created() : super.created() { | 1432 DebuggerPageElement.created() : super.created() { |
| 1345 debugger.page = this; | 1433 debugger.page = this; |
| 1346 } | 1434 } |
| 1347 | 1435 |
| 1348 Future<StreamSubscription> _isolateSubscriptionFuture; | 1436 Future<StreamSubscription> _isolateSubscriptionFuture; |
| 1349 Future<StreamSubscription> _debugSubscriptionFuture; | 1437 Future<StreamSubscription> _debugSubscriptionFuture; |
| 1350 Future<StreamSubscription> _stdoutSubscriptionFuture; | 1438 Future<StreamSubscription> _stdoutSubscriptionFuture; |
| 1351 Future<StreamSubscription> _stderrSubscriptionFuture; | 1439 Future<StreamSubscription> _stderrSubscriptionFuture; |
| 1440 Future<StreamSubscription> _logSubscriptionFuture; |
| 1352 | 1441 |
| 1353 @override | 1442 @override |
| 1354 void attached() { | 1443 void attached() { |
| 1355 super.attached(); | 1444 super.attached(); |
| 1356 | 1445 |
| 1357 var navbarDiv = $['navbarDiv']; | 1446 var navbarDiv = $['navbarDiv']; |
| 1358 var stackDiv = $['stackDiv']; | 1447 var stackDiv = $['stackDiv']; |
| 1359 var splitterDiv = $['splitterDiv']; | 1448 var splitterDiv = $['splitterDiv']; |
| 1360 var cmdDiv = $['commandDiv']; | 1449 var cmdDiv = $['commandDiv']; |
| 1361 | 1450 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1379 debugger.init(); | 1468 debugger.init(); |
| 1380 | 1469 |
| 1381 _isolateSubscriptionFuture = | 1470 _isolateSubscriptionFuture = |
| 1382 app.vm.listenEventStream(VM.kIsolateStream, debugger.onEvent); | 1471 app.vm.listenEventStream(VM.kIsolateStream, debugger.onEvent); |
| 1383 _debugSubscriptionFuture = | 1472 _debugSubscriptionFuture = |
| 1384 app.vm.listenEventStream(VM.kDebugStream, debugger.onEvent); | 1473 app.vm.listenEventStream(VM.kDebugStream, debugger.onEvent); |
| 1385 _stdoutSubscriptionFuture = | 1474 _stdoutSubscriptionFuture = |
| 1386 app.vm.listenEventStream(VM.kStdoutStream, debugger.onStdout); | 1475 app.vm.listenEventStream(VM.kStdoutStream, debugger.onStdout); |
| 1387 _stderrSubscriptionFuture = | 1476 _stderrSubscriptionFuture = |
| 1388 app.vm.listenEventStream(VM.kStderrStream, debugger.onStderr); | 1477 app.vm.listenEventStream(VM.kStderrStream, debugger.onStderr); |
| 1389 | 1478 _logSubscriptionFuture = |
| 1479 app.vm.listenEventStream(Isolate.kLoggingStream, debugger.onEvent); |
| 1390 // Turn on the periodic poll timer for this page. | 1480 // Turn on the periodic poll timer for this page. |
| 1391 pollPeriod = const Duration(milliseconds:100); | 1481 pollPeriod = const Duration(milliseconds:100); |
| 1392 | 1482 |
| 1393 onClick.listen((event) { | 1483 onClick.listen((event) { |
| 1394 // Random clicks should focus on the text box. If the user selects | 1484 // Random clicks should focus on the text box. If the user selects |
| 1395 // a range, don't interfere. | 1485 // a range, don't interfere. |
| 1396 var selection = window.getSelection(); | 1486 var selection = window.getSelection(); |
| 1397 if (selection == null || selection.type == 'Caret') { | 1487 if (selection == null || selection.type == 'Caret') { |
| 1398 debugger.input.focus(); | 1488 debugger.input.focus(); |
| 1399 } | 1489 } |
| 1400 }); | 1490 }); |
| 1401 } | 1491 } |
| 1402 | 1492 |
| 1403 void onPoll() { | 1493 void onPoll() { |
| 1404 debugger.flushStdio(); | 1494 debugger.flushStdio(); |
| 1405 } | 1495 } |
| 1406 | 1496 |
| 1407 @override | 1497 @override |
| 1408 void detached() { | 1498 void detached() { |
| 1499 debugger.isolate = null; |
| 1409 cancelFutureSubscription(_isolateSubscriptionFuture); | 1500 cancelFutureSubscription(_isolateSubscriptionFuture); |
| 1410 _isolateSubscriptionFuture = null; | 1501 _isolateSubscriptionFuture = null; |
| 1411 cancelFutureSubscription(_debugSubscriptionFuture); | 1502 cancelFutureSubscription(_debugSubscriptionFuture); |
| 1412 _debugSubscriptionFuture = null; | 1503 _debugSubscriptionFuture = null; |
| 1413 cancelFutureSubscription(_stdoutSubscriptionFuture); | 1504 cancelFutureSubscription(_stdoutSubscriptionFuture); |
| 1414 _stdoutSubscriptionFuture = null; | 1505 _stdoutSubscriptionFuture = null; |
| 1415 cancelFutureSubscription(_stderrSubscriptionFuture); | 1506 cancelFutureSubscription(_stderrSubscriptionFuture); |
| 1416 _stderrSubscriptionFuture = null; | 1507 _stderrSubscriptionFuture = null; |
| 1508 cancelFutureSubscription(_logSubscriptionFuture); |
| 1509 _logSubscriptionFuture = null; |
| 1417 super.detached(); | 1510 super.detached(); |
| 1418 } | 1511 } |
| 1419 } | 1512 } |
| 1420 | 1513 |
| 1421 @CustomTag('debugger-stack') | 1514 @CustomTag('debugger-stack') |
| 1422 class DebuggerStackElement extends ObservatoryElement { | 1515 class DebuggerStackElement extends ObservatoryElement { |
| 1423 @published Isolate isolate; | 1516 @published Isolate isolate; |
| 1424 @observable bool hasStack = false; | 1517 @observable bool hasStack = false; |
| 1425 @observable bool hasMessages = false; | 1518 @observable bool hasMessages = false; |
| 1426 @observable bool isSampled = false; | 1519 @observable bool isSampled = false; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 } | 1975 } |
| 1883 }); | 1976 }); |
| 1884 } | 1977 } |
| 1885 | 1978 |
| 1886 void focus() { | 1979 void focus() { |
| 1887 $['textBox'].focus(); | 1980 $['textBox'].focus(); |
| 1888 } | 1981 } |
| 1889 | 1982 |
| 1890 DebuggerInputElement.created() : super.created(); | 1983 DebuggerInputElement.created() : super.created(); |
| 1891 } | 1984 } |
| OLD | NEW |