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

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

Issue 12179020: Fix for issues 6080 - pass in the Isolate's top context into the stub for invoking dart code from n… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 friend class Debugger; 113 friend class Debugger;
114 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint); 114 DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);
115 }; 115 };
116 116
117 117
118 // ActivationFrame represents one dart function activation frame 118 // ActivationFrame represents one dart function activation frame
119 // on the call stack. 119 // on the call stack.
120 class ActivationFrame : public ZoneAllocated { 120 class ActivationFrame : public ZoneAllocated {
121 public: 121 public:
122 ActivationFrame(uword pc, uword fp, uword sp, 122 ActivationFrame(uword pc, uword fp, uword sp, const Code& code);
123 const Code& code, const Context& ctx);
124 123
125 uword pc() const { return pc_; } 124 uword pc() const { return pc_; }
126 uword fp() const { return fp_; } 125 uword fp() const { return fp_; }
127 uword sp() const { return sp_; } 126 uword sp() const { return sp_; }
128 const Function& function() const { 127 const Function& function() const {
129 ASSERT(!function_.IsNull()); 128 ASSERT(!function_.IsNull());
130 return function_; 129 return function_;
131 } 130 }
132 const Code& code() const { 131 const Code& code() const {
133 ASSERT(!code_.IsNull()); 132 ASSERT(!code_.IsNull());
134 return code_; 133 return code_;
135 } 134 }
136 135
137 RawString* QualifiedFunctionName(); 136 RawString* QualifiedFunctionName();
138 RawString* SourceUrl(); 137 RawString* SourceUrl();
139 RawScript* SourceScript(); 138 RawScript* SourceScript();
140 RawLibrary* Library(); 139 RawLibrary* Library();
141 intptr_t TokenPos(); 140 intptr_t TokenPos();
142 intptr_t LineNumber(); 141 intptr_t LineNumber();
142 void SetContext(const Context& ctx) { ctx_ = ctx.raw(); }
143 143
144 // The context level of a frame is the context level at the 144 // The context level of a frame is the context level at the
145 // PC/token index of the frame. It determines the depth of the context 145 // PC/token index of the frame. It determines the depth of the context
146 // chain that belongs to the function of this activation frame. 146 // chain that belongs to the function of this activation frame.
147 intptr_t ContextLevel(); 147 intptr_t ContextLevel();
148 148
149 const char* ToCString(); 149 const char* ToCString();
150 150
151 intptr_t NumLocalVariables(); 151 intptr_t NumLocalVariables();
152 152
153 void VariableAt(intptr_t i, 153 void VariableAt(intptr_t i,
154 String* name, 154 String* name,
155 intptr_t* token_pos, 155 intptr_t* token_pos,
156 intptr_t* end_pos, 156 intptr_t* end_pos,
157 Instance* value); 157 Instance* value);
158 158
159 RawArray* GetLocalVariables(); 159 RawArray* GetLocalVariables();
160 RawContext* CallerContext(); 160 RawContext* GetSavedContext();
161 161
162 private: 162 private:
163 intptr_t PcDescIndex(); 163 intptr_t PcDescIndex();
164 intptr_t TryIndex(); 164 intptr_t TryIndex();
165 void GetPcDescriptors(); 165 void GetPcDescriptors();
166 void GetVarDescriptors(); 166 void GetVarDescriptors();
167 void GetDescIndices(); 167 void GetDescIndices();
168 RawInstance* GetLocalVarValue(intptr_t slot_index); 168 RawInstance* GetLocalVarValue(intptr_t slot_index);
169 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args); 169 RawInstance* GetInstanceCallReceiver(intptr_t num_actual_args);
170 170
171 uword pc_; 171 uword pc_;
172 uword fp_; 172 uword fp_;
173 uword sp_; 173 uword sp_;
174 174
175 // The anchor of the context chain for this function. 175 // The anchor of the context chain for this function.
176 const Context& ctx_; 176 Context& ctx_;
177 const Code& code_; 177 const Code& code_;
178 const Function& function_; 178 const Function& function_;
179 intptr_t token_pos_; 179 intptr_t token_pos_;
180 intptr_t pc_desc_index_; 180 intptr_t pc_desc_index_;
181 intptr_t line_number_; 181 intptr_t line_number_;
182 intptr_t context_level_; 182 intptr_t context_level_;
183 183
184 bool vars_initialized_; 184 bool vars_initialized_;
185 LocalVarDescriptors& var_descriptors_; 185 LocalVarDescriptors& var_descriptors_;
186 ZoneGrowableArray<intptr_t> desc_indices_; 186 ZoneGrowableArray<intptr_t> desc_indices_;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 static EventHandler* event_handler_; 382 static EventHandler* event_handler_;
383 383
384 friend class SourceBreakpoint; 384 friend class SourceBreakpoint;
385 DISALLOW_COPY_AND_ASSIGN(Debugger); 385 DISALLOW_COPY_AND_ASSIGN(Debugger);
386 }; 386 };
387 387
388 388
389 } // namespace dart 389 } // namespace dart
390 390
391 #endif // VM_DEBUGGER_H_ 391 #endif // VM_DEBUGGER_H_
OLDNEW
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698