Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: runtime/vm/debugger.h

Issue 10579020: Support captured variables in debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); 113 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);
114 }; 114 };
115 115
116 116
117 117
118 118
119 // ActivationFrame represents one dart function activation frame 119 // ActivationFrame represents one dart function activation frame
120 // on the call stack. 120 // on the call stack.
121 class ActivationFrame : public ZoneAllocated { 121 class ActivationFrame : public ZoneAllocated {
122 public: 122 public:
123 explicit ActivationFrame(uword pc, uword fp, uword sp); 123 explicit ActivationFrame(uword pc, uword fp, uword sp, const Context& ctx);
124 124
125 uword pc() const { return pc_; } 125 uword pc() const { return pc_; }
126 uword fp() const { return fp_; } 126 uword fp() const { return fp_; }
127 uword sp() const { return sp_; } 127 uword sp() const { return sp_; }
128 128
129 const Function& DartFunction(); 129 const Function& DartFunction();
130 RawString* QualifiedFunctionName(); 130 RawString* QualifiedFunctionName();
131 RawString* SourceUrl(); 131 RawString* SourceUrl();
132 RawScript* SourceScript(); 132 RawScript* SourceScript();
133 intptr_t TokenIndex(); 133 intptr_t TokenIndex();
134 intptr_t LineNumber(); 134 intptr_t LineNumber();
135 intptr_t ContextLevel();
regis 2012/06/19 18:14:41 Add comment explaining what is the context level o
hausner 2012/06/19 18:49:41 Correct. Added the comment.
135 const char* ToCString(); 136 const char* ToCString();
136 137
137 intptr_t NumLocalVariables(); 138 intptr_t NumLocalVariables();
138 139
139 void VariableAt(intptr_t i, 140 void VariableAt(intptr_t i,
140 String* name, 141 String* name,
141 intptr_t* token_pos, 142 intptr_t* token_pos,
142 intptr_t* end_pos, 143 intptr_t* end_pos,
143 Instance* value); 144 Instance* value);
144 145
145 RawArray* GetLocalVariables(); 146 RawArray* GetLocalVariables();
147 RawContext* CallerContext();
146 148
147 private: 149 private:
150 intptr_t PcDescIndex();
151 void GetPcDescriptors();
152 void GetVarDescriptors();
148 void GetDescIndices(); 153 void GetDescIndices();
149 RawInstance* GetLocalVarValue(intptr_t slot_index); 154 RawInstance* GetLocalVarValue(intptr_t slot_index);
150 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args); 155 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args);
151 156
152 uword pc_; 157 uword pc_;
153 uword fp_; 158 uword fp_;
154 uword sp_; 159 uword sp_;
160 const Context& ctx_;
155 Function& function_; 161 Function& function_;
156 intptr_t token_index_; 162 intptr_t token_index_;
163 intptr_t pc_desc_index_;
157 intptr_t line_number_; 164 intptr_t line_number_;
165 intptr_t context_level_;
158 166
167 bool vars_initialized_;
159 LocalVarDescriptors& var_descriptors_; 168 LocalVarDescriptors& var_descriptors_;
160 ZoneGrowableArray<intptr_t> desc_indices_; 169 ZoneGrowableArray<intptr_t> desc_indices_;
170 PcDescriptors& pc_desc_;
161 171
162 friend class Debugger; 172 friend class Debugger;
163 DISALLOW_COPY_AND_ASSIGN(ActivationFrame); 173 DISALLOW_COPY_AND_ASSIGN(ActivationFrame);
164 }; 174 };
165 175
166 176
167 // Array of function activations on the call stack. 177 // Array of function activations on the call stack.
168 class DebuggerStackTrace : public ZoneAllocated { 178 class DebuggerStackTrace : public ZoneAllocated {
169 public: 179 public:
170 explicit DebuggerStackTrace(int capacity) 180 explicit DebuggerStackTrace(int capacity)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 intptr_t exc_pause_info_; 340 intptr_t exc_pause_info_;
331 341
332 friend class SourceBreakpoint; 342 friend class SourceBreakpoint;
333 DISALLOW_COPY_AND_ASSIGN(Debugger); 343 DISALLOW_COPY_AND_ASSIGN(Debugger);
334 }; 344 };
335 345
336 346
337 } // namespace dart 347 } // namespace dart
338 348
339 #endif // VM_DEBUGGER_H_ 349 #endif // VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/debugger.cc » ('j') | runtime/vm/debugger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698