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

Unified Diff: runtime/vm/debugger.cc

Issue 1299083002: Automagically change the meaning of 'next' to 'async-next' when paused at an async function at awai… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/debugger.h ('k') | runtime/vm/service_event.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 5573f4bd9e0475cf5c09f63077ed897f74ebd8a6..2855c1826009d6cc2882bb3f356cdadf2be7bba2 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -2395,7 +2395,17 @@ void Debugger::SignalPausedEvent(ActivationFrame* top_frame,
event.set_top_frame(top_frame);
event.set_breakpoint(bpt);
Object& closure_or_null = Object::Handle(top_frame->GetAsyncOperation());
- event.set_async_continuation(&closure_or_null);
+ if (!closure_or_null.IsNull()) {
+ event.set_async_continuation(&closure_or_null);
+ const Script& script = Script::Handle(top_frame->SourceScript());
+ const TokenStream& tokens = TokenStream::Handle(script.tokens());
+ TokenStream::Iterator iter(tokens, top_frame->TokenPos());
+ if ((iter.CurrentTokenKind() == Token::kIDENT) &&
+ ((iter.CurrentLiteral() == Symbols::Await().raw()) ||
+ (iter.CurrentLiteral() == Symbols::YieldKw().raw()))) {
+ event.set_at_async_jump(true);
+ }
+ }
Pause(&event);
}
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/service_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698