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

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

Issue 1636083002: Improve Observatory debugger behaviour when an isolate exits with unhandled exceptions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/tests/service/pause_on_unhandled_exceptions_test.dart » ('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 88653a57e24092f250122ea287b3b3f31e3ba710..06f91e799d14e4d6da8ff17950d752789b54e5ed 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -1378,7 +1378,6 @@ class ObservatoryDebugger extends Debugger {
if ((breakOnException != iso.exceptionsPauseInfo) &&
(iso.exceptionsPauseInfo != null)) {
breakOnException = iso.exceptionsPauseInfo;
- console.print("Now pausing for exceptions: $breakOnException");
}
_isolate.reload().then((response) {
@@ -1493,6 +1492,25 @@ class ObservatoryDebugger extends Debugger {
warnOutOfDate();
}
+ void _reportIsolateError(Isolate isolate) {
+ if (isolate == null) {
+ return;
+ }
+ DartError error = isolate.error;
+ if (error == null) {
+ return;
+ }
+ console.newline();
+ console.printBold('Isolate exited due to an unhandled exception:');
+ console.print(error.message);
+ console.newline();
+ console.printBold("Type 'set break-on-exception Unhandled' to pause the"
+ " isolate when an unhandled exception occurs.");
+ console.newline();
+ console.printBold("You can make this the default by running with "
+ "--pause-isolates-on-unhandled-exceptions");
+ }
+
void _reportPause(ServiceEvent event) {
if (event.kind == ServiceEvent.kPauseStart) {
console.print(
@@ -1502,6 +1520,7 @@ class ObservatoryDebugger extends Debugger {
console.print(
"Paused at isolate exit "
"(type 'continue' or [F7] to exit the isolate')");
+ _reportIsolateError(isolate);
} else if (stack['frames'].length > 0) {
Frame frame = stack['frames'][0];
var script = frame.location.script;
@@ -1618,8 +1637,11 @@ class ObservatoryDebugger extends Debugger {
case ServiceEvent.kPauseInterrupted:
case ServiceEvent.kPauseException:
if (event.owner == isolate) {
- _refreshStack(event).then((_) {
+ _refreshStack(event).then((_) async {
flushStdio();
+ if (isolate != null) {
+ await isolate.reload();
+ }
_reportPause(event);
});
}
« no previous file with comments | « no previous file | runtime/observatory/tests/service/pause_on_unhandled_exceptions_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698