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

Unified Diff: runtime/vm/debugger.cc

Issue 2815863002: Detect unhandled exceptions in async functions without an awaiter (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index b1a0cecead5f373cca55b1bc131180f0851ec71e..2afa616f6275c0232b4a2193d228bcf0056c8dd6 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -939,7 +939,15 @@ const Context& ActivationFrame::GetSavedCurrentContext() {
OS::PrintErr("\tFound saved current ctx at index %d\n",
var_info.index());
}
- ctx_ ^= GetStackVar(var_info.index());
+ const Object& obj = Object::Handle(GetStackVar(var_info.index()));
+ if (obj.IsClosure()) {
+ // Closure.call frames.
+ ctx_ ^= Closure::Cast(obj).context();
rmacnak 2017/04/12 16:53:03 The parser is uniformly creating a scope entry for
+ } else if (obj.IsContext()) {
+ ctx_ ^= Context::Cast(obj).raw();
+ } else {
+ ASSERT(obj.IsNull());
+ }
return ctx_;
}
}
@@ -2049,6 +2057,7 @@ DebuggerStackTrace* Debugger::CollectAwaiterReturnStackTrace() {
stack_trace->AddActivation(activation);
// Grab the awaiter.
async_activation ^= activation->GetAsyncAwaiter();
+ async_stack_trace ^= activation->GetCausalStack();
break;
} else {
stack_trace->AddActivation(CollectDartFrame(
@@ -2058,12 +2067,6 @@ DebuggerStackTrace* Debugger::CollectAwaiterReturnStackTrace() {
}
}
- // Return NULL to indicate that there is no useful information in this stack
- // trace because we never found an awaiter.
- if (async_activation.IsNull()) {
- return NULL;
- }
-
// Append the awaiter return call stack.
while (!async_activation.IsNull()) {
ActivationFrame* activation = new (zone) ActivationFrame(async_activation);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698