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

Unified Diff: runtime/vm/isolate.cc

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 | « runtime/vm/exceptions.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 3758c21b45c33b3df71ef6aac59c221a8eaaee7c..6f20df9b6fdf23bea25fd27e0f6d352f0e146096 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -655,20 +655,6 @@ static MessageHandler::MessageStatus StoreError(Thread* thread,
MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
const Error& result) {
- // Notify the debugger about specific unhandled exceptions which are withheld
- // when being thrown.
- if (result.IsUnhandledException()) {
- const UnhandledException& error = UnhandledException::Cast(result);
- RawInstance* exception = error.exception();
- if ((exception == I->object_store()->out_of_memory()) ||
- (exception == I->object_store()->stack_overflow())) {
- // We didn't notify the debugger when the stack was full. Do it now.
- if (FLAG_support_debugger) {
- I->debugger()->SignalExceptionThrown(Instance::Handle(exception));
- }
- }
- }
-
// Generate the error and stacktrace strings for the error message.
String& exc_str = String::Handle(T->zone());
String& stacktrace_str = String::Handle(T->zone());
@@ -704,6 +690,21 @@ MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
} else {
T->set_sticky_error(result);
}
+ // Notify the debugger about specific unhandled exceptions which are
+ // withheld when being thrown. Do this after setting the sticky error
+ // so the isolate has an error set when paused with the unhandled
+ // exception.
+ if (result.IsUnhandledException()) {
+ const UnhandledException& error = UnhandledException::Cast(result);
+ RawInstance* exception = error.exception();
+ if ((exception == I->object_store()->out_of_memory()) ||
+ (exception == I->object_store()->stack_overflow())) {
+ // We didn't notify the debugger when the stack was full. Do it now.
+ if (FLAG_support_debugger) {
+ I->debugger()->SignalExceptionThrown(Instance::Handle(exception));
+ }
+ }
+ }
return kError;
}
}
« no previous file with comments | « runtime/vm/exceptions.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698