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

Unified Diff: runtime/vm/debugger.cc

Issue 2366463002: Fix stepping over await statements (Closed)
Patch Set: wip Created 4 years, 3 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/observatory/tests/service/step_over_await_test.dart ('k') | 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 a4afc16275873e52c3b3dac54563a4b5253b7e86..c076689dac5508438ec321fad19b6df5dc83e06b 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -376,6 +376,17 @@ Breakpoint* BreakpointLocation::AddPerClosure(Debugger* dbg,
if (bpt->IsPerClosure() && bpt->closure() == closure.raw()) break;
bpt = bpt->next();
}
+ if (for_over_await &&
+ (bpt != NULL) &&
+ (bpt == dbg->synthetic_async_breakpoint_)) {
+ // If the debugger is paused after stepping over an await statement,
Cutch 2016/09/21 23:43:45 I wonder if we could just do the following in this
hausner 2016/09/21 23:59:28 Why is it important to create a new synthetic BP e
+ // the synthetic breakpoint is temporarily kept in
+ // synthetic_async_breakpoint_ so it can be deleted when the step
+ // command resumes.
+ // If another step request over an async statement is issued, make
+ // sure the synthetic breakpoint does not get deleted.
+ dbg->synthetic_async_breakpoint_ = NULL;
+ }
if (bpt == NULL) {
bpt = new Breakpoint(dbg->nextId(), this);
bpt->SetIsPerClosure(closure);
« no previous file with comments | « runtime/observatory/tests/service/step_over_await_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698