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

Unified Diff: runtime/vm/debugger.cc

Issue 2632183002: Debugging in kernel shaping up. (Closed)
Patch Set: Changed to TokenPosition::kMaxSourcePos Created 3 years, 11 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/dart_api_impl.cc ('k') | runtime/vm/kernel.h » ('j') | 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 3dce57392b6fe5e4c27ca441cd835d36f8b2b2b6..4b145ad272440d11d2a50f55365e7996385eadfe 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -2929,6 +2929,14 @@ bool Debugger::IsAtAsyncJump(ActivationFrame* top_frame) {
ASSERT(Instance::Cast(closure_or_null).IsClosure());
const Script& script = Script::Handle(zone, top_frame->SourceScript());
if (script.kind() == RawScript::kKernelTag) {
+ // Are we at a yield point (previous await)?
+ const Array& yields = Array::Handle(script.yield_positions());
+ intptr_t looking_for = top_frame->TokenPos().value();
+ Smi& value = Smi::Handle(zone);
+ for (int i = 0; i < yields.Length(); i++) {
+ value ^= yields.At(i);
+ if (value.Value() == looking_for) return true;
+ }
return false;
}
const TokenStream& tokens = TokenStream::Handle(zone, script.tokens());
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698