Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: runtime/observatory/lib/src/elements/debugger.dart

Issue 1965823002: Initial isolate reload support (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/elements/debugger.dart
diff --git a/runtime/observatory/lib/src/elements/debugger.dart b/runtime/observatory/lib/src/elements/debugger.dart
index 81541ef595d7032a7b5e2d3f36859e6fee758bc9..61a8989d60b4dd1737a817f739e05a2b6f5fc4c5 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -902,6 +902,7 @@ class IsolateCommand extends DebuggerCommand {
IsolateCommand(Debugger debugger) : super(debugger, 'isolate', [
new IsolateListCommand(debugger),
new IsolateNameCommand(debugger),
+ new IsolateReloadCommand(debugger),
]) {
alias = 'i';
}
@@ -962,10 +963,10 @@ class IsolateCommand extends DebuggerCommand {
}
return new Future.value(result);
}
- String helpShort = 'Switch the current isolate';
+ String helpShort = 'Switch, list, rename, or reload isolates';
String helpLong =
- 'Switch, list, or rename isolates.\n'
+ 'Switch the current isolate.\n'
'\n'
'Syntax: isolate <number>\n'
' isolate <name>\n';
@@ -1042,14 +1043,36 @@ class IsolateNameCommand extends DebuggerCommand {
return debugger.isolate.setName(args[0]);
}
- String helpShort = 'Rename an isolate';
+ String helpShort = 'Rename the current isolate';
String helpLong =
- 'Rename an isolate.\n'
+ 'Rename the current isolate.\n'
'\n'
'Syntax: isolate name <name>\n';
}
+class IsolateReloadCommand extends DebuggerCommand {
+ IsolateReloadCommand(Debugger debugger) : super(debugger, 'reload', []);
+
+ Future run(List<String> args) async {
+ if (debugger.isolate == null) {
+ debugger.console.print('There is no current vm');
+ return;
+ }
+
+ await debugger.isolate.reloadSources();
+
+ debugger.console.print('Isolate reloading....');
+ }
+
+ String helpShort = 'Reload the sources for the current isolate.';
+
+ String helpLong =
+ 'Reload the sources for the current isolate.\n'
+ '\n'
+ 'Syntax: reload\n';
+}
+
class InfoCommand extends DebuggerCommand {
InfoCommand(Debugger debugger) : super(debugger, 'info', [
new InfoBreakpointsCommand(debugger),
@@ -1650,6 +1673,15 @@ class ObservatoryDebugger extends Debugger {
console.print("Isolate ${iso.number} renamed to '${iso.name}'");
break;
+ case ServiceEvent.kIsolateReload:
+ var reloadError = event.reloadError;
+ if (reloadError != null) {
+ console.print('Isolate reload failed: ${event.reloadError}');
+ } else {
+ console.print('Isolate reloaded.');
+ }
+ break;
+
case ServiceEvent.kPauseStart:
case ServiceEvent.kPauseExit:
case ServiceEvent.kPauseBreakpoint:

Powered by Google App Engine
This is Rietveld 408576698