Chromium Code Reviews| Index: runtime/vm/debugger.h |
| =================================================================== |
| --- runtime/vm/debugger.h (revision 31244) |
| +++ runtime/vm/debugger.h (working copy) |
| @@ -27,42 +27,46 @@ |
| // SourceBreakpoint. |
| class SourceBreakpoint { |
| public: |
|
turnidge
2013/12/19 22:31:59
Maybe comment whether the range includes end or no
hausner
2013/12/21 00:08:32
obsolete
|
| - SourceBreakpoint(intptr_t id, const Function& func, intptr_t token_pos); |
| + SourceBreakpoint(intptr_t id, const Script& script, |
| + intptr_t range_start, |
| + intptr_t range_end); |
| RawFunction* function() const { return function_; } |
| intptr_t token_pos() const { return token_pos_; } |
| - void set_token_pos(intptr_t value) { token_pos_ = value; } |
| intptr_t id() const { return id_; } |
| - RawScript* SourceCode(); |
| + RawScript* script() { return script_; } |
| RawString* SourceUrl(); |
| intptr_t LineNumber(); |
| - void GetCodeLocation(Library* lib, |
| - Script* script, |
| - intptr_t* token_pos) const; |
| + void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos); |
| void Enable(); |
| void Disable(); |
| bool IsEnabled() const { return is_enabled_; } |
| + bool IsResolved() { return token_pos_ >= 0; } |
| - void PrintToJSONStream(JSONStream* stream) const; |
| + void PrintToJSONStream(JSONStream* stream); |
| private: |
| void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| - void set_function(const Function& func); |
| + void SetResolved(const Function& func, intptr_t token_pos); |
| void set_next(SourceBreakpoint* value) { next_ = value; } |
| SourceBreakpoint* next() const { return this->next_; } |
| const intptr_t id_; |
| + RawScript* script_; |
| + const intptr_t range_start_; |
| + const intptr_t range_end_; |
| + bool is_enabled_; |
| + SourceBreakpoint* next_; |
| + |
| + // Valid for resolved breakpoints: |
| RawFunction* function_; |
| intptr_t token_pos_; |
| intptr_t line_number_; |
| - bool is_enabled_; |
| - SourceBreakpoint* next_; |
| - |
| friend class Debugger; |
| DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); |
| }; |
| @@ -370,11 +374,24 @@ |
| kSingleStep |
| }; |
| + void FindAllFunctions(const Script& script, |
| + intptr_t start_pos, |
| + intptr_t end_pos, |
| + GrowableObjectArray* function_list); |
| + RawFunction* FindBestFit(const Script& script, |
| + intptr_t range_start, |
| + intptr_t range_end); |
| + RawFunction* FindInnermostClosure(const Function& function, |
| + intptr_t range_start, |
| + intptr_t range_end); |
| intptr_t ResolveBreakpointPos(const Function& func, |
| intptr_t first_token_pos, |
| intptr_t last_token_pos); |
| void DeoptimizeWorld(); |
| void InstrumentForStepping(const Function& target_function); |
| + SourceBreakpoint* SetBreakpoint(const Script& script, |
| + intptr_t range_start, |
| + intptr_t range_end); |
| SourceBreakpoint* SetBreakpoint(const Function& target_function, |
| intptr_t first_token_pos, |
| intptr_t last_token_pos); |
| @@ -382,10 +399,11 @@ |
| void UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt); |
| void RegisterSourceBreakpoint(SourceBreakpoint* bpt); |
| void RegisterCodeBreakpoint(CodeBreakpoint* bpt); |
| - SourceBreakpoint* GetSourceBreakpoint(const Function& func, |
| - intptr_t token_pos); |
| + SourceBreakpoint* GetResolvedBreakpoint(const Script& script, |
| + intptr_t token_pos); |
| + SourceBreakpoint* GetUnresolvedBreakpoint(const Script& script, |
| + intptr_t range_start); |
| void MakeCodeBreakpointsAt(const Function& func, |
| - intptr_t token_pos, |
| SourceBreakpoint* bpt); |
| // Returns NULL if no breakpoint exists for the given address. |
| CodeBreakpoint* GetCodeBreakpoint(uword breakpoint_address); |