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_debugger_api.h" | 8 #include "include/dart_debugger_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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 void SignalBpReached(); | 507 void SignalBpReached(); |
508 void DebuggerStepCallback(); | 508 void DebuggerStepCallback(); |
509 | 509 |
510 void BreakHere(const String& msg); | 510 void BreakHere(const String& msg); |
511 | 511 |
512 void SignalExceptionThrown(const Instance& exc); | 512 void SignalExceptionThrown(const Instance& exc); |
513 void SignalIsolateEvent(DebuggerEvent::EventType type); | 513 void SignalIsolateEvent(DebuggerEvent::EventType type); |
514 static void SignalIsolateInterrupted(); | 514 static void SignalIsolateInterrupted(); |
515 | 515 |
516 uword GetPatchedStubAddress(uword breakpoint_address); | 516 RawCode* GetPatchedStubAddress(uword breakpoint_address); |
517 | 517 |
518 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; | 518 void PrintBreakpointsToJSONArray(JSONArray* jsarr) const; |
519 void PrintSettingsToJSONObject(JSONObject* jsobj) const; | 519 void PrintSettingsToJSONObject(JSONObject* jsobj) const; |
520 | 520 |
521 static bool IsDebuggable(const Function& func); | 521 static bool IsDebuggable(const Function& func); |
522 | 522 |
523 private: | 523 private: |
524 enum ResumeAction { | 524 enum ResumeAction { |
525 kContinue, | 525 kContinue, |
526 kStepOver, | 526 kStepOver, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 632 |
633 friend class Isolate; | 633 friend class Isolate; |
634 friend class BreakpointLocation; | 634 friend class BreakpointLocation; |
635 DISALLOW_COPY_AND_ASSIGN(Debugger); | 635 DISALLOW_COPY_AND_ASSIGN(Debugger); |
636 }; | 636 }; |
637 | 637 |
638 | 638 |
639 } // namespace dart | 639 } // namespace dart |
640 | 640 |
641 #endif // VM_DEBUGGER_H_ | 641 #endif // VM_DEBUGGER_H_ |
OLD | NEW |