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); |