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

Unified Diff: runtime/vm/debugger.cc

Issue 2366463002: Fix stepping over await statements (Closed)
Patch Set: Merge branch 'master' into deb 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..54694feafbf7cd28b1e33e5f8286f1f33c7e93fd 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -371,10 +371,16 @@ Breakpoint* BreakpointLocation::AddSingleShot(Debugger* dbg) {
Breakpoint* BreakpointLocation::AddPerClosure(Debugger* dbg,
const Instance& closure,
bool for_over_await) {
- Breakpoint* bpt = breakpoints();
- while (bpt != NULL) {
- if (bpt->IsPerClosure() && bpt->closure() == closure.raw()) break;
- bpt = bpt->next();
+ Breakpoint* bpt = NULL;
+ // Do not reuse existing breakpoints for stepping over await clauses.
+ // A second async step-over command will set a new breakpoint before
+ // the existing one gets deleted when first async step-over resumes.
+ if (!for_over_await) {
+ bpt = breakpoints();
+ while (bpt != NULL) {
+ if (bpt->IsPerClosure() && (bpt->closure() == closure.raw())) break;
+ bpt = bpt->next();
+ }
}
if (bpt == NULL) {
bpt = new Breakpoint(dbg->nextId(), this);
« 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