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

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

Issue 1709383002: Improve behaviour when we hit a stack overflow / OOM error (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 3bf25b567eea41e1d2e11dab34f09e09f6f5bcd8..b063d2eddc351cfcea2ab77bce04010c2c31ec2b 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -1492,7 +1492,7 @@ class ObservatoryDebugger extends Debugger {
warnOutOfDate();
}
- void _reportIsolateError(Isolate isolate) {
+ void _reportIsolateError(Isolate isolate, String eventKind) {
if (isolate == null) {
return;
}
@@ -1501,14 +1501,23 @@ class ObservatoryDebugger extends Debugger {
return;
}
console.newline();
- console.printBold('Isolate exited due to an unhandled exception:');
+ if (eventKind == ServiceEvent.kPauseException) {
+ console.printBold('Isolate will exit due to an unhandled exception:');
+ } else {
+ console.printBold('Isolate has 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");
+ if (error.exception.isStackOverflowError ||
+ error.exception.isOutOfMemoryError) {
+ console.printBold('The unhandled exception is a stack overflow or out of '
+ 'memory therefor the isolate cannot be paused.');
rmacnak 2016/02/22 17:55:27 therefore
Cutch 2016/02/22 18:38:17 Done.
+ } else {
+ console.printBold("Type 'set break-on-exception Unhandled' to pause the"
+ " isolate when an unhandled exception occurs.");
+ console.printBold("You can make this the default by running with "
+ "--pause-isolates-on-unhandled-exceptions");
+ }
}
void _reportPause(ServiceEvent event) {
@@ -1520,7 +1529,12 @@ class ObservatoryDebugger extends Debugger {
console.print(
"Paused at isolate exit "
"(type 'continue' or [F7] to exit the isolate')");
- _reportIsolateError(isolate);
+ _reportIsolateError(isolate, event.kind);
+ } else if (event.kind == ServiceEvent.kPauseException) {
+ console.print(
+ "Paused at an unhandled exception "
+ "(type 'continue' or [F7] to exit the isolate')");
+ _reportIsolateError(isolate, event.kind);
} else if (stack['frames'].length > 0) {
Frame frame = stack['frames'][0];
var script = frame.location.script;

Powered by Google App Engine
This is Rietveld 408576698