| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/object.h" | 8 #include "vm/object.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 | 100 |
| 101 typedef void BreakpointHandler(Breakpoint* bpt, StackTrace* stack); | 101 typedef void BreakpointHandler(Breakpoint* bpt, StackTrace* stack); |
| 102 | 102 |
| 103 | 103 |
| 104 class Debugger { | 104 class Debugger { |
| 105 public: | 105 public: |
| 106 Debugger(); | 106 Debugger(); |
| 107 | 107 |
| 108 void Initialize(Isolate* isolate); | 108 void Initialize(Isolate* isolate); |
| 109 bool IsActive(); |
| 109 | 110 |
| 110 void SetBreakpointHandler(BreakpointHandler* handler); | 111 void SetBreakpointHandler(BreakpointHandler* handler); |
| 111 | 112 |
| 113 RawFunction* ResolveFunction(const Library& library, |
| 114 const String& class_name, |
| 115 const String& function_name); |
| 116 |
| 112 // Set breakpoint at closest location to function entry. | 117 // Set breakpoint at closest location to function entry. |
| 113 void SetBreakpointAtEntry(const String& class_name, | 118 Breakpoint* SetBreakpointAtEntry(const Function& target_function); |
| 114 const String& function_name); | |
| 115 | 119 |
| 116 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 120 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 117 | 121 |
| 118 // Returns NULL if no breakpoint exists for the given address. | 122 // Returns NULL if no breakpoint exists for the given address. |
| 119 Breakpoint* GetBreakpoint(uword breakpoint_address); | 123 Breakpoint* GetBreakpoint(uword breakpoint_address); |
| 120 | 124 |
| 121 // Called from Runtime when a breakpoint in Dart code is reached. | 125 // Called from Runtime when a breakpoint in Dart code is reached. |
| 122 void BreakpointCallback(); | 126 void BreakpointCallback(); |
| 123 | 127 |
| 124 private: | 128 private: |
| 125 void AddBreakpoint(Breakpoint* bpt); | 129 void AddBreakpoint(Breakpoint* bpt); |
| 126 | 130 |
| 127 bool initialized_; | 131 bool initialized_; |
| 128 BreakpointHandler* bp_handler_; | 132 BreakpointHandler* bp_handler_; |
| 129 Breakpoint* breakpoints_; | 133 Breakpoint* breakpoints_; |
| 130 DISALLOW_COPY_AND_ASSIGN(Debugger); | 134 DISALLOW_COPY_AND_ASSIGN(Debugger); |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 | 137 |
| 134 } // namespace dart | 138 } // namespace dart |
| 135 | 139 |
| 136 #endif // VM_DEBUGGER_H_ | 140 #endif // VM_DEBUGGER_H_ |
| OLD | NEW |