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

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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/isolate_summary.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 3bf25b567eea41e1d2e11dab34f09e09f6f5bcd8..6595447668fe6edf0c83f9110a3fa778b57b4aae 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,26 @@ 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 (eventKind == ServiceEvent.kPauseException &&
+ (error.exception.isStackOverflowError ||
+ error.exception.isOutOfMemoryError)) {
+ console.printBold(
+ 'When an unhandled stack overflow or OOM exception occurs, the VM '
+ 'has run out of memory and cannot keep the stack alive while '
+ 'paused.');
+ } 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 +1532,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;
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/isolate_summary.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698