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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
| 94 |
93 private: | 95 private: |
94 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 96 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
95 | 97 |
96 SourceBreakpoint* src_bpt() const { return src_bpt_; } | 98 SourceBreakpoint* src_bpt() const { return src_bpt_; } |
97 void set_src_bpt(SourceBreakpoint* value) { src_bpt_ = value; } | 99 void set_src_bpt(SourceBreakpoint* value) { src_bpt_ = value; } |
98 | 100 |
99 void set_next(CodeBreakpoint* value) { next_ = value; } | 101 void set_next(CodeBreakpoint* value) { next_ = value; } |
100 CodeBreakpoint* next() const { return this->next_; } | 102 CodeBreakpoint* next() const { return this->next_; } |
101 intptr_t pc_desc_index() const { return pc_desc_index_; } | 103 intptr_t pc_desc_index() const { return pc_desc_index_; } |
102 | 104 |
103 void PatchCode(); | 105 void PatchCode(); |
104 void RestoreCode(); | 106 void RestoreCode(); |
105 | 107 |
106 RawFunction* function_; | 108 RawFunction* function_; |
107 intptr_t pc_desc_index_; | 109 intptr_t pc_desc_index_; |
108 intptr_t token_pos_; | 110 intptr_t token_pos_; |
109 uword pc_; | 111 uword pc_; |
110 intptr_t line_number_; | 112 intptr_t line_number_; |
111 bool is_enabled_; | 113 bool is_enabled_; |
112 | 114 |
113 SourceBreakpoint* src_bpt_; | 115 SourceBreakpoint* src_bpt_; |
114 CodeBreakpoint* next_; | 116 CodeBreakpoint* next_; |
115 | 117 |
116 PcDescriptors::Kind breakpoint_kind_; | 118 PcDescriptors::Kind breakpoint_kind_; |
117 union { | 119 uword saved_value_; |
118 uword target_address_; | |
119 uint8_t raw[2 * sizeof(uword)]; | |
120 } saved_bytes_; | |
121 | 120 |
122 friend class Debugger; | 121 friend class Debugger; |
123 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); | 122 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); |
124 }; | 123 }; |
125 | 124 |
126 | 125 |
127 // ActivationFrame represents one dart function activation frame | 126 // ActivationFrame represents one dart function activation frame |
128 // on the call stack. | 127 // on the call stack. |
129 class ActivationFrame : public ZoneAllocated { | 128 class ActivationFrame : public ZoneAllocated { |
130 public: | 129 public: |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 472 |
474 friend class Isolate; | 473 friend class Isolate; |
475 friend class SourceBreakpoint; | 474 friend class SourceBreakpoint; |
476 DISALLOW_COPY_AND_ASSIGN(Debugger); | 475 DISALLOW_COPY_AND_ASSIGN(Debugger); |
477 }; | 476 }; |
478 | 477 |
479 | 478 |
480 } // namespace dart | 479 } // namespace dart |
481 | 480 |
482 #endif // VM_DEBUGGER_H_ | 481 #endif // VM_DEBUGGER_H_ |
OLD | NEW |