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 70d8516ff539f8d31408ccb54130f90c5090211f..6f4c39f7690e059b10659c85977f6cfb50002d32 100644 |
--- a/runtime/observatory/lib/src/elements/debugger.dart |
+++ b/runtime/observatory/lib/src/elements/debugger.dart |
@@ -366,6 +366,34 @@ class FinishCommand extends DebuggerCommand { |
'Syntax: finish\n'; |
} |
+class BreakOnExceptionsCommand extends DebuggerCommand { |
+ BreakOnExceptionsCommand(Debugger debugger) |
+ : super(debugger, 'break-on-exceptions', []); |
rmacnak
2015/06/11 17:31:17
Don't really want to introduce the first hyphenate
Cutch
2015/06/11 21:20:12
What about a 'set' command for configuring behavio
rmacnak
2015/06/12 00:09:38
Somewhat better.
|
+ |
+ Future run(List<String> args) async { |
+ if (args.length == 0) { |
+ var result = await debugger.isolate.getExceptionPauseInfo(); |
+ debugger.console.print(result.toString()); |
+ } else if (args.length == 1) { |
+ var result = await debugger.isolate.setExceptionPauseInfo(args[0]); |
+ debugger.console.print(result.toString()); |
+ } else { |
+ debugger.console.print("break-on-exceptions expects 0 or 1 argument"); |
+ } |
+ } |
+ |
+ String helpShort = |
+ 'Set the break-on-exceptions policy: all, none or unhandled'; |
+ |
+ String helpLong = |
+ 'Set the break-on-exceptions policy: all, none or unhandled' |
+ '\n' |
+ 'Syntax: break-on-exceptions "all" | "none" | "unhandled"' |
+ '- Set the policy\n' |
+ ' break-on-exceptions ' |
+ '- Query the policy\n'; |
+} |
+ |
class BreakCommand extends DebuggerCommand { |
BreakCommand(Debugger debugger) : super(debugger, 'break', []); |
@@ -856,6 +884,7 @@ class ObservatoryDebugger extends Debugger { |
new StepCommand(this), |
new FinishCommand(this), |
new BreakCommand(this), |
+ new BreakOnExceptionsCommand(this), |
new ClearCommand(this), |
new DeleteCommand(this), |
new InfoCommand(this), |
@@ -992,9 +1021,12 @@ class ObservatoryDebugger extends Debugger { |
console.print('Paused at breakpoint ${bpId} at ' |
'${script.name}:${line}:${col}'); |
} else if (event.exception != null) { |
- // TODO(turnidge): Test this. |
- console.print('Paused due to exception ${event.exception} at ' |
+ console.print('Paused due to exception at ' |
'${script.name}:${line}:${col}'); |
+ // This seems to be missing if we are paused-at-exception after |
+ // paused-at-isolate-exit. Maybe we shutdown part of the debugger too |
+ // soon? |
+ console.printRef(event.exception); |
} else { |
console.print('Paused at ${script.name}:${line}:${col}'); |
} |