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

Unified Diff: runtime/vm/debugger.cc

Issue 2777093006: Implement debugger support for async step-out (Closed)
Patch Set: rmacnak review Created 3 years, 9 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') | 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 26113e2af4b61f522ba5ee3df745feff3efca082..4dbf87e8c46038f1cb5e3dcb01f34b745b4ce20e 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -786,16 +786,16 @@ RawObject* ActivationFrame::GetAsyncStreamControllerStreamAwaiter(
RawObject* ActivationFrame::GetAsyncAwaiter() {
- const Object& completer = Object::Handle(GetAsyncCompleter());
- if (!completer.IsNull()) {
- return GetAsyncCompleterAwaiter(completer);
- }
const Object& async_stream_controller_stream =
Object::Handle(GetAsyncStreamControllerStream());
if (!async_stream_controller_stream.IsNull()) {
return GetAsyncStreamControllerStreamAwaiter(
async_stream_controller_stream);
}
+ const Object& completer = Object::Handle(GetAsyncCompleter());
+ if (!completer.IsNull()) {
+ return GetAsyncCompleterAwaiter(completer);
+ }
return Object::null();
}
@@ -3229,6 +3229,21 @@ void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace,
OS::Print("HandleSteppingRequest- kStepOver %" Px "\n", stepping_fp_);
}
} else if (resume_action_ == kStepOut) {
+ if (FLAG_async_debugger_stepping) {
+ if (stack_trace->FrameAt(0)->function().IsAsyncClosure() ||
+ stack_trace->FrameAt(0)->function().IsAsyncGenClosure()) {
+ // Request to step out of an async/async* closure.
+ const Object& async_op =
+ Object::Handle(stack_trace->FrameAt(0)->GetAsyncAwaiter());
+ if (!async_op.IsNull()) {
+ // Step out to the awaiter.
+ ASSERT(async_op.IsClosure());
+ AsyncStepInto(Closure::Cast(async_op));
+ return;
+ }
+ }
+ }
+ // Fall through to synchronous stepping.
DeoptimizeWorld();
isolate_->set_single_step(true);
// Find topmost caller that is debuggable.
@@ -4206,12 +4221,17 @@ void Debugger::MaybeAsyncStepInto(const Closure& async_op) {
if (FLAG_async_debugger_stepping && IsSingleStepping()) {
// We are single stepping, set a breakpoint on the closure activation
// and resume execution so we can hit the breakpoint.
- SetBreakpointAtActivation(async_op, true);
- Continue();
+ AsyncStepInto(async_op);
}
}
+void Debugger::AsyncStepInto(const Closure& async_op) {
+ SetBreakpointAtActivation(async_op, true);
+ Continue();
+}
+
+
void Debugger::Continue() {
SetResumeAction(kContinue);
stepping_fp_ = 0;
« no previous file with comments | « runtime/vm/debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698