OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_DEBUGGER_H_ | 5 #ifndef VM_DEBUGGER_H_ |
6 #define VM_DEBUGGER_H_ | 6 #define VM_DEBUGGER_H_ |
7 | 7 |
8 #include "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
9 | 9 |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 bool IsInternal() const { return bpt_location_ == NULL; } | 171 bool IsInternal() const { return bpt_location_ == NULL; } |
172 | 172 |
173 RawScript* SourceCode(); | 173 RawScript* SourceCode(); |
174 RawString* SourceUrl(); | 174 RawString* SourceUrl(); |
175 intptr_t LineNumber(); | 175 intptr_t LineNumber(); |
176 | 176 |
177 void Enable(); | 177 void Enable(); |
178 void Disable(); | 178 void Disable(); |
179 bool IsEnabled() const { return is_enabled_; } | 179 bool IsEnabled() const { return is_enabled_; } |
180 | 180 |
181 uword OrigStubAddress() const; | 181 RawCode* OrigStubAddress() const; |
182 | 182 |
183 private: | 183 private: |
184 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 184 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
185 | 185 |
186 BreakpointLocation* bpt_location() const { return bpt_location_; } | 186 BreakpointLocation* bpt_location() const { return bpt_location_; } |
187 void set_bpt_location(BreakpointLocation* value) { bpt_location_ = value; } | 187 void set_bpt_location(BreakpointLocation* value) { bpt_location_ = value; } |
188 | 188 |
189 void set_next(CodeBreakpoint* value) { next_ = value; } | 189 void set_next(CodeBreakpoint* value) { next_ = value; } |
190 CodeBreakpoint* next() const { return this->next_; } | 190 CodeBreakpoint* next() const { return this->next_; } |
191 | 191 |
192 void PatchCode(); | 192 void PatchCode(); |
193 void RestoreCode(); | 193 void RestoreCode(); |
194 | 194 |
195 RawCode* code_; | 195 RawCode* code_; |
196 intptr_t token_pos_; | 196 intptr_t token_pos_; |
197 uword pc_; | 197 uword pc_; |
198 intptr_t line_number_; | 198 intptr_t line_number_; |
199 bool is_enabled_; | 199 bool is_enabled_; |
200 | 200 |
201 BreakpointLocation* bpt_location_; | 201 BreakpointLocation* bpt_location_; |
202 CodeBreakpoint* next_; | 202 CodeBreakpoint* next_; |
203 | 203 |
204 RawPcDescriptors::Kind breakpoint_kind_; | 204 RawPcDescriptors::Kind breakpoint_kind_; |
205 uword saved_value_; | 205 RawCode* saved_value_; |
206 | 206 |
207 friend class Debugger; | 207 friend class Debugger; |
208 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); | 208 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); |
209 }; | 209 }; |
210 | 210 |
211 | 211 |
212 // ActivationFrame represents one dart function activation frame | 212 // ActivationFrame represents one dart function activation frame |
213 // on the call stack. | 213 // on the call stack. |
214 class ActivationFrame : public ZoneAllocated { | 214 class ActivationFrame : public ZoneAllocated { |
215 public: | 215 public: |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 541 |
542 void SignalBpReached(); | 542 void SignalBpReached(); |
543 void DebuggerStepCallback(); | 543 void DebuggerStepCallback(); |
544 | 544 |
545 void BreakHere(const String& msg); | 545 void BreakHere(const String& msg); |
546 | 546 |
547 void SignalExceptionThrown(const Instance& exc); | 547 void SignalExceptionThrown(const Instance& exc); |
548 void SignalIsolateEvent(DebuggerEvent::EventType type); | 548 void SignalIsolateEvent(DebuggerEvent::EventType type); |
549 static void SignalIsolateInterrupted(); | 549 static void SignalIsolateInterrupted(); |
550 | 550 |
551 uword GetPatchedStubAddress(uword breakpoint_address); | 551 RawCode* GetPatchedStubAddress(uword breakpoint_address); |
552 | 552 |
553 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; | 553 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; |
554 void PrintSettingsToJSONObject(JSONObject* jsobj) const; | 554 void PrintSettingsToJSONObject(JSONObject* jsobj) const; |
555 | 555 |
556 static bool IsDebuggable(const Function& func); | 556 static bool IsDebuggable(const Function& func); |
557 | 557 |
558 private: | 558 private: |
559 enum ResumeAction { | 559 enum ResumeAction { |
560 kContinue, | 560 kContinue, |
561 kStepOver, | 561 kStepOver, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 667 |
668 friend class Isolate; | 668 friend class Isolate; |
669 friend class BreakpointLocation; | 669 friend class BreakpointLocation; |
670 DISALLOW_COPY_AND_ASSIGN(Debugger); | 670 DISALLOW_COPY_AND_ASSIGN(Debugger); |
671 }; | 671 }; |
672 | 672 |
673 | 673 |
674 } // namespace dart | 674 } // namespace dart |
675 | 675 |
676 #endif // VM_DEBUGGER_H_ | 676 #endif // VM_DEBUGGER_H_ |
OLD | NEW |