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

Unified Diff: runtime/vm/debugger.h

Issue 1699153002: Add step OverAwait to service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/vm_timeline_flags_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « runtime/observatory/tests/service/vm_timeline_flags_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698