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

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

Issue 1194103002: Observatory UI tweaks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/instance_view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16874a6cfaee3594ac5ca7c0a82651291d29fabc..2fc89dac77b1d6d5fd4c2cd6224696cc08fa890a 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -110,21 +110,24 @@ class PrintCommand extends DebuggerCommand {
alias = 'p';
}
- Future run(List<String> args) {
+ Future run(List<String> args) async {
if (args.length < 1) {
debugger.console.print('print expects arguments');
- return new Future.value(null);
+ return;
+ }
+ if (debugger.currentFrame == null) {
+ debugger.console.print('No stack');
+ return;
+ }
+ var expression = args.join('');
+ var response = await debugger.isolate.evalFrame(debugger.currentFrame,
+ expression);
+ if (response is DartError) {
+ debugger.console.print(response.message);
+ } else {
+ debugger.console.print('= ', newline:false);
+ debugger.console.printRef(response);
}
- var expr = args.join('');
- return debugger.isolate.evalFrame(debugger.currentFrame, expr)
- .then((ServiceObject response) {
- if (response is DartError) {
- debugger.console.print(response.message);
- } else {
- debugger.console.print('= ', newline:false);
- debugger.console.printRef(response);
- }
- });
}
String helpShort = 'Evaluate and print an expression in the current frame';
@@ -315,7 +318,9 @@ class NextCommand extends DebuggerCommand {
}
class StepCommand extends DebuggerCommand {
- StepCommand(Debugger debugger) : super(debugger, 'step', []);
+ StepCommand(Debugger debugger) : super(debugger, 'step', []) {
+ alias = 's';
+ }
Future run(List<String> args) {
if (debugger.isolatePaused()) {
@@ -1179,7 +1184,7 @@ class ObservatoryDebugger extends Debugger {
return completions[0];
} else {
// Ambigous completion.
- completions = completions.map((s )=> s.trimRight()).toList();
+ completions = completions.map((s) => s.trimRight()).toList();
console.printBold(completions.toString());
return _foldCompletions(completions);
}
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/instance_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698