Index: runtime/vm/debugger.h |
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h |
index d6904d56a656b054e34cc3dffba293d283ce2f02..4d00a34100f901ca335b6f648228cb27f05bc0b2 100644 |
--- a/runtime/vm/debugger.h |
+++ b/runtime/vm/debugger.h |
@@ -30,7 +30,8 @@ class Breakpoint { |
kind_(Breakpoint::kNone), |
next_(NULL), |
closure_(Instance::null()), |
- bpt_location_(bpt_location) {} |
+ bpt_location_(bpt_location), |
+ is_synthetic_async_(false) {} |
intptr_t id() const { return id_; } |
Breakpoint* next() const { return next_; } |
@@ -60,6 +61,14 @@ class Breakpoint { |
closure_ = closure.raw(); |
} |
+ // Mark that this breakpoint is a result of a step OverAwait request. |
+ void set_is_synthetic_async(bool is_synthetic_async) { |
+ is_synthetic_async_ = is_synthetic_async; |
+ } |
+ bool is_synthetic_async() const { |
+ return is_synthetic_async_; |
+ } |
+ |
void PrintJSON(JSONStream* stream); |
private: |
@@ -77,6 +86,7 @@ class Breakpoint { |
Breakpoint* next_; |
RawInstance* closure_; |
BreakpointLocation* bpt_location_; |
+ bool is_synthetic_async_; |
friend class BreakpointLocation; |
DISALLOW_COPY_AND_ASSIGN(Breakpoint); |
@@ -128,7 +138,9 @@ class BreakpointLocation { |
Breakpoint* AddRepeated(Debugger* dbg); |
Breakpoint* AddSingleShot(Debugger* dbg); |
- Breakpoint* AddPerClosure(Debugger* dbg, const Instance& closure); |
+ Breakpoint* AddPerClosure(Debugger* dbg, |
+ const Instance& closure, |
+ bool for_over_await); |
bool AnyEnabled() const; |
bool IsResolved() const { return is_resolved_; } |
@@ -467,7 +479,8 @@ class Debugger { |
// Set breakpoint at closest location to function entry. |
Breakpoint* SetBreakpointAtEntry(const Function& target_function, |
bool single_shot); |
- Breakpoint* SetBreakpointAtActivation(const Instance& closure); |
+ Breakpoint* SetBreakpointAtActivation(const Instance& closure, |
+ bool for_over_await); |
Breakpoint* BreakpointAtActivation(const Instance& closure); |
// TODO(turnidge): script_url may no longer be specific enough. |
@@ -486,6 +499,8 @@ class Debugger { |
void RemoveBreakpoint(intptr_t bp_id); |
Breakpoint* GetBreakpointById(intptr_t id); |
+ // Will return false if we are not at an await. |
+ bool SetupStepOverAsyncSuspension(); |
void SetStepOver(); |
void SetSingleStep(); |
void SetStepOut(); |
@@ -587,7 +602,7 @@ class Debugger { |
static bool HasAnyEventHandler(); |
static bool HasDebugEventHandler(); |
void InvokeEventHandler(DebuggerEvent* event); |
- |
+ bool IsAtAsyncJump(ActivationFrame* top_frame); |
void FindCompiledFunctions(const Script& script, |
TokenPosition start_pos, |
TokenPosition end_pos, |
@@ -696,6 +711,11 @@ class Debugger { |
// breakpoint. |
bool skip_next_step_; |
+ // We keep this breakpoint alive until after the debugger does the step over |
+ // async continuation machinery so that we can report that we've stopped |
+ // at the breakpoint. |
+ Breakpoint* synthetic_async_breakpoint_; |
+ |
Dart_ExceptionPauseInfo exc_pause_info_; |
static EventHandler* event_handler_; |