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" |
11 #include "vm/port.h" | 11 #include "vm/port.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 class ActiveVariables; | |
16 class CodeBreakpoint; | 15 class CodeBreakpoint; |
17 class Isolate; | 16 class Isolate; |
18 class JSONArray; | 17 class JSONArray; |
19 class JSONStream; | 18 class JSONStream; |
20 class ObjectPointerVisitor; | 19 class ObjectPointerVisitor; |
21 class RemoteObjectCache; | 20 class RemoteObjectCache; |
22 class SourceBreakpoint; | 21 class SourceBreakpoint; |
23 class StackFrame; | 22 class StackFrame; |
24 | 23 |
25 // SourceBreakpoint represents a user-specified breakpoint location in | 24 // SourceBreakpoint represents a user-specified breakpoint location in |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return code_; | 166 return code_; |
168 } | 167 } |
169 | 168 |
170 RawString* QualifiedFunctionName(); | 169 RawString* QualifiedFunctionName(); |
171 RawString* SourceUrl(); | 170 RawString* SourceUrl(); |
172 RawScript* SourceScript(); | 171 RawScript* SourceScript(); |
173 RawLibrary* Library(); | 172 RawLibrary* Library(); |
174 intptr_t TokenPos(); | 173 intptr_t TokenPos(); |
175 intptr_t LineNumber(); | 174 intptr_t LineNumber(); |
176 intptr_t ColumnNumber(); | 175 intptr_t ColumnNumber(); |
177 void SetContext(const Context& ctx) { ctx_ = ctx.raw(); } | |
178 | 176 |
179 // Returns true if this frame is for a function that is visible | 177 // Returns true if this frame is for a function that is visible |
180 // to the user and can be debugged. | 178 // to the user and can be debugged. |
181 bool IsDebuggable() const; | 179 bool IsDebuggable() const; |
182 | 180 |
183 // The context level of a frame is the context level at the | 181 // The context level of a frame is the context level at the |
184 // PC/token index of the frame. It determines the depth of the context | 182 // PC/token index of the frame. It determines the depth of the context |
185 // chain that belongs to the function of this activation frame. | 183 // chain that belongs to the function of this activation frame. |
186 intptr_t ContextLevel(); | 184 intptr_t ContextLevel(); |
187 | 185 |
188 const char* ToCString(); | 186 const char* ToCString(); |
189 | 187 |
190 intptr_t NumLocalVariables(); | 188 intptr_t NumLocalVariables(); |
191 | 189 |
192 void VariableAt(intptr_t i, | 190 void VariableAt(intptr_t i, |
193 String* name, | 191 String* name, |
194 intptr_t* token_pos, | 192 intptr_t* token_pos, |
195 intptr_t* end_pos, | 193 intptr_t* end_pos, |
196 Object* value); | 194 Object* value); |
197 | 195 |
198 RawArray* GetLocalVariables(); | 196 RawArray* GetLocalVariables(); |
199 RawObject* GetReceiver(); | 197 RawObject* GetReceiver(); |
200 | 198 |
201 RawContext* GetSavedCurrentContext(); | 199 const Context& GetSavedCurrentContext(); |
202 | 200 |
203 RawObject* Evaluate(const String& expr); | 201 RawObject* Evaluate(const String& expr); |
204 | 202 |
205 void PrintToJSONObject(JSONObject* jsobj); | 203 void PrintToJSONObject(JSONObject* jsobj); |
206 | 204 |
207 private: | 205 private: |
208 void PrintContextMismatchError(const String& var_name, | 206 void PrintContextMismatchError(const String& var_name, |
209 intptr_t ctx_slot, | 207 intptr_t ctx_slot, |
210 intptr_t frame_ctx_level, | 208 intptr_t frame_ctx_level, |
211 intptr_t var_ctx_level); | 209 intptr_t var_ctx_level); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 561 |
564 friend class Isolate; | 562 friend class Isolate; |
565 friend class SourceBreakpoint; | 563 friend class SourceBreakpoint; |
566 DISALLOW_COPY_AND_ASSIGN(Debugger); | 564 DISALLOW_COPY_AND_ASSIGN(Debugger); |
567 }; | 565 }; |
568 | 566 |
569 | 567 |
570 } // namespace dart | 568 } // namespace dart |
571 | 569 |
572 #endif // VM_DEBUGGER_H_ | 570 #endif // VM_DEBUGGER_H_ |
OLD | NEW |