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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 friend class Debugger; | 67 friend class Debugger; |
68 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); | 68 DISALLOW_COPY_AND_ASSIGN(SourceBreakpoint); |
69 }; | 69 }; |
70 | 70 |
71 | 71 |
72 // CodeBreakpoint represents a location in compiled code. There may be | 72 // CodeBreakpoint represents a location in compiled code. There may be |
73 // more than one CodeBreakpoint for one SourceBreakpoint, e.g. when a | 73 // more than one CodeBreakpoint for one SourceBreakpoint, e.g. when a |
74 // function gets compiled as a regular function and as a closure. | 74 // function gets compiled as a regular function and as a closure. |
75 class CodeBreakpoint { | 75 class CodeBreakpoint { |
76 public: | 76 public: |
77 CodeBreakpoint(const Function& func, intptr_t pc_desc_index); | 77 CodeBreakpoint(const Code& code, intptr_t pc_desc_index); |
78 ~CodeBreakpoint(); | 78 ~CodeBreakpoint(); |
79 | 79 |
80 RawFunction* function() const { return function_; } | 80 RawFunction* function() const; |
81 uword pc() const { return pc_; } | 81 uword pc() const { return pc_; } |
82 intptr_t token_pos() const { return token_pos_; } | 82 intptr_t token_pos() const { return token_pos_; } |
83 bool IsInternal() const { return src_bpt_ == NULL; } | 83 bool IsInternal() const { return src_bpt_ == NULL; } |
84 | 84 |
85 RawScript* SourceCode(); | 85 RawScript* SourceCode(); |
86 RawString* SourceUrl(); | 86 RawString* SourceUrl(); |
87 intptr_t LineNumber(); | 87 intptr_t LineNumber(); |
88 | 88 |
89 void Enable(); | 89 void Enable(); |
90 void Disable(); | 90 void Disable(); |
91 bool IsEnabled() const { return is_enabled_; } | 91 bool IsEnabled() const { return is_enabled_; } |
92 | 92 |
93 uword OrigStubAddress() const; | 93 uword OrigStubAddress() const; |
94 | 94 |
95 private: | 95 private: |
96 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 96 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
97 | 97 |
98 SourceBreakpoint* src_bpt() const { return src_bpt_; } | 98 SourceBreakpoint* src_bpt() const { return src_bpt_; } |
99 void set_src_bpt(SourceBreakpoint* value) { src_bpt_ = value; } | 99 void set_src_bpt(SourceBreakpoint* value) { src_bpt_ = value; } |
100 | 100 |
101 void set_next(CodeBreakpoint* value) { next_ = value; } | 101 void set_next(CodeBreakpoint* value) { next_ = value; } |
102 CodeBreakpoint* next() const { return this->next_; } | 102 CodeBreakpoint* next() const { return this->next_; } |
103 intptr_t pc_desc_index() const { return pc_desc_index_; } | 103 intptr_t pc_desc_index() const { return pc_desc_index_; } |
104 | 104 |
105 void PatchCode(); | 105 void PatchCode(); |
106 void RestoreCode(); | 106 void RestoreCode(); |
107 | 107 |
108 RawFunction* function_; | 108 RawCode* code_; |
109 intptr_t pc_desc_index_; | 109 intptr_t pc_desc_index_; |
110 intptr_t token_pos_; | 110 intptr_t token_pos_; |
111 uword pc_; | 111 uword pc_; |
112 intptr_t line_number_; | 112 intptr_t line_number_; |
113 bool is_enabled_; | 113 bool is_enabled_; |
114 | 114 |
115 SourceBreakpoint* src_bpt_; | 115 SourceBreakpoint* src_bpt_; |
116 CodeBreakpoint* next_; | 116 CodeBreakpoint* next_; |
117 | 117 |
118 PcDescriptors::Kind breakpoint_kind_; | 118 PcDescriptors::Kind breakpoint_kind_; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 476 |
477 friend class Isolate; | 477 friend class Isolate; |
478 friend class SourceBreakpoint; | 478 friend class SourceBreakpoint; |
479 DISALLOW_COPY_AND_ASSIGN(Debugger); | 479 DISALLOW_COPY_AND_ASSIGN(Debugger); |
480 }; | 480 }; |
481 | 481 |
482 | 482 |
483 } // namespace dart | 483 } // namespace dart |
484 | 484 |
485 #endif // VM_DEBUGGER_H_ | 485 #endif // VM_DEBUGGER_H_ |
OLD | NEW |