@@ -4470,37 +4470,6 @@ ErrorPtr Debugger::PauseStepping() {
44704470 ActivationFrame* frame = TopDartFrame ();
44714471 ASSERT (frame != NULL );
44724472
4473- // Since lazy async stacks doesn't use the _asyncStackTraceHelper runtime
4474- // entry, we need to manually set a synthetic breakpoint for async_op before
4475- // we enter it.
4476- if (FLAG_lazy_async_stacks) {
4477- // async and async* functions always contain synthetic async_ops.
4478- if ((frame->function ().IsAsyncFunction () ||
4479- frame->function ().IsAsyncGenerator ())) {
4480- ASSERT (!frame->GetSavedCurrentContext ().IsNull ());
4481- ASSERT (frame->GetSavedCurrentContext ().num_variables () >
4482- Context::kAsyncCompleterIndex );
4483-
4484- const Object& jump_var = Object::Handle (
4485- frame->GetSavedCurrentContext ().At (Context::kAsyncCompleterIndex ));
4486-
4487- // Only set breakpoint when entering async_op the first time.
4488- // :async_completer_var should be uninitialised at this point:
4489- if (jump_var.IsNull ()) {
4490- const Function& async_op =
4491- Function::Handle (frame->function ().GetGeneratedClosure ());
4492- if (!async_op.IsNull ()) {
4493- SetBreakpointAtAsyncOp (async_op);
4494- // After setting the breakpoint we stop stepping and continue the
4495- // debugger until the next breakpoint, to step over all the
4496- // synthetic code.
4497- Continue ();
4498- return Error::null ();
4499- }
4500- }
4501- }
4502- }
4503-
45044473 if (FLAG_async_debugger) {
45054474 if ((async_stepping_fp_ != 0 ) && (top_frame_awaiter_ != Object::null ())) {
45064475 // Check if the user has single stepped out of an async function with
@@ -4539,6 +4508,37 @@ ErrorPtr Debugger::PauseStepping() {
45394508 }
45404509 }
45414510
4511+ // Since lazy async stacks doesn't use the _asyncStackTraceHelper runtime
4512+ // entry, we need to manually set a synthetic breakpoint for async_op before
4513+ // we enter it.
4514+ if (FLAG_lazy_async_stacks) {
4515+ // async and async* functions always contain synthetic async_ops.
4516+ if ((frame->function ().IsAsyncFunction () ||
4517+ frame->function ().IsAsyncGenerator ())) {
4518+ ASSERT (!frame->GetSavedCurrentContext ().IsNull ());
4519+ ASSERT (frame->GetSavedCurrentContext ().num_variables () >
4520+ Context::kAsyncCompleterIndex );
4521+
4522+ const Object& async_completer = Object::Handle (
4523+ frame->GetSavedCurrentContext ().At (Context::kAsyncCompleterIndex ));
4524+
4525+ // Only set breakpoint when entering async_op the first time.
4526+ // :async_completer_var should be uninitialised at this point:
4527+ if (async_completer.IsNull ()) {
4528+ const Function& async_op =
4529+ Function::Handle (frame->function ().GetGeneratedClosure ());
4530+ if (!async_op.IsNull ()) {
4531+ SetBreakpointAtAsyncOp (async_op);
4532+ // After setting the breakpoint we stop stepping and continue the
4533+ // debugger until the next breakpoint, to step over all the
4534+ // synthetic code.
4535+ Continue ();
4536+ return Error::null ();
4537+ }
4538+ }
4539+ }
4540+ }
4541+
45424542 if (!frame->IsDebuggable ()) {
45434543 return Error::null ();
45444544 }
0 commit comments