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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ASSERT(!code_.IsNull()); | 137 ASSERT(!code_.IsNull()); |
138 return code_; | 138 return code_; |
139 } | 139 } |
140 | 140 |
141 RawString* QualifiedFunctionName(); | 141 RawString* QualifiedFunctionName(); |
142 RawString* SourceUrl(); | 142 RawString* SourceUrl(); |
143 RawScript* SourceScript(); | 143 RawScript* SourceScript(); |
144 RawLibrary* Library(); | 144 RawLibrary* Library(); |
145 intptr_t TokenPos(); | 145 intptr_t TokenPos(); |
146 intptr_t LineNumber(); | 146 intptr_t LineNumber(); |
| 147 intptr_t ColumnNumber(); |
147 void SetContext(const Context& ctx) { ctx_ = ctx.raw(); } | 148 void SetContext(const Context& ctx) { ctx_ = ctx.raw(); } |
148 | 149 |
149 // Returns true if this frame is for a function that is visible | 150 // Returns true if this frame is for a function that is visible |
150 // to the user and can be debugged. | 151 // to the user and can be debugged. |
151 bool IsDebuggable() const; | 152 bool IsDebuggable() const; |
152 | 153 |
153 // The context level of a frame is the context level at the | 154 // The context level of a frame is the context level at the |
154 // PC/token index of the frame. It determines the depth of the context | 155 // PC/token index of the frame. It determines the depth of the context |
155 // chain that belongs to the function of this activation frame. | 156 // chain that belongs to the function of this activation frame. |
156 intptr_t ContextLevel(); | 157 intptr_t ContextLevel(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 uword fp_; | 190 uword fp_; |
190 uword sp_; | 191 uword sp_; |
191 | 192 |
192 // The anchor of the context chain for this function. | 193 // The anchor of the context chain for this function. |
193 Context& ctx_; | 194 Context& ctx_; |
194 const Code& code_; | 195 const Code& code_; |
195 const Function& function_; | 196 const Function& function_; |
196 intptr_t token_pos_; | 197 intptr_t token_pos_; |
197 intptr_t pc_desc_index_; | 198 intptr_t pc_desc_index_; |
198 intptr_t line_number_; | 199 intptr_t line_number_; |
| 200 intptr_t column_number_; |
199 intptr_t context_level_; | 201 intptr_t context_level_; |
200 | 202 |
201 // Some frames are deoptimized into a side array in order to inspect them. | 203 // Some frames are deoptimized into a side array in order to inspect them. |
202 const Array& deopt_frame_; | 204 const Array& deopt_frame_; |
203 const intptr_t deopt_frame_offset_; | 205 const intptr_t deopt_frame_offset_; |
204 | 206 |
205 bool vars_initialized_; | 207 bool vars_initialized_; |
206 LocalVarDescriptors& var_descriptors_; | 208 LocalVarDescriptors& var_descriptors_; |
207 ZoneGrowableArray<intptr_t> desc_indices_; | 209 ZoneGrowableArray<intptr_t> desc_indices_; |
208 PcDescriptors& pc_desc_; | 210 PcDescriptors& pc_desc_; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 295 |
294 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 296 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
295 | 297 |
296 // Called from Runtime when a breakpoint in Dart code is reached. | 298 // Called from Runtime when a breakpoint in Dart code is reached. |
297 void BreakpointCallback(); | 299 void BreakpointCallback(); |
298 | 300 |
299 // Returns true if there is at least one breakpoint set in func. | 301 // Returns true if there is at least one breakpoint set in func. |
300 // Checks for both user-defined and internal temporary breakpoints. | 302 // Checks for both user-defined and internal temporary breakpoints. |
301 bool HasBreakpoint(const Function& func); | 303 bool HasBreakpoint(const Function& func); |
302 | 304 |
| 305 // Returns a stack trace with frames corresponding to invisible functions |
| 306 // omitted. CurrentStackTrace always returns a new trace on the current stack. |
| 307 // The trace returned by StackTrace may have been cached; it is suitable for |
| 308 // use when stepping, but otherwise may be out of sync with the current stack. |
303 DebuggerStackTrace* StackTrace(); | 309 DebuggerStackTrace* StackTrace(); |
| 310 DebuggerStackTrace* CurrentStackTrace(); |
| 311 |
| 312 // Returns a debugger stack trace corresponding to a dart.core.Stacktrace. |
| 313 // Frames corresponding to invisible functions are omitted. It is not valid |
| 314 // to query local variables in the returned stack. |
| 315 DebuggerStackTrace* StackTraceFrom(const Stacktrace& dart_stacktrace); |
304 | 316 |
305 RawArray* GetInstanceFields(const Instance& obj); | 317 RawArray* GetInstanceFields(const Instance& obj); |
306 RawArray* GetStaticFields(const Class& cls); | 318 RawArray* GetStaticFields(const Class& cls); |
307 RawArray* GetLibraryFields(const Library& lib); | 319 RawArray* GetLibraryFields(const Library& lib); |
308 RawArray* GetGlobalFields(const Library& lib); | 320 RawArray* GetGlobalFields(const Library& lib); |
309 | 321 |
310 intptr_t CacheObject(const Object& obj); | 322 intptr_t CacheObject(const Object& obj); |
311 RawObject* GetCachedObject(intptr_t obj_id); | 323 RawObject* GetCachedObject(intptr_t obj_id); |
312 bool IsValidObjectId(intptr_t obj_id); | 324 bool IsValidObjectId(intptr_t obj_id); |
313 | 325 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 436 |
425 friend class Isolate; | 437 friend class Isolate; |
426 friend class SourceBreakpoint; | 438 friend class SourceBreakpoint; |
427 DISALLOW_COPY_AND_ASSIGN(Debugger); | 439 DISALLOW_COPY_AND_ASSIGN(Debugger); |
428 }; | 440 }; |
429 | 441 |
430 | 442 |
431 } // namespace dart | 443 } // namespace dart |
432 | 444 |
433 #endif // VM_DEBUGGER_H_ | 445 #endif // VM_DEBUGGER_H_ |
OLD | NEW |