OLD | NEW |
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 // ---------------------------------------------------------------------------- | 8 // ---------------------------------------------------------------------------- |
9 // Imports | 9 // Imports |
10 | 10 |
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 result += this.localsText(); | 2170 result += this.localsText(); |
2171 } | 2171 } |
2172 return result; | 2172 return result; |
2173 }; | 2173 }; |
2174 | 2174 |
2175 | 2175 |
2176 // This indexes correspond definitions in debug-scopes.h. | 2176 // This indexes correspond definitions in debug-scopes.h. |
2177 var kScopeDetailsTypeIndex = 0; | 2177 var kScopeDetailsTypeIndex = 0; |
2178 var kScopeDetailsObjectIndex = 1; | 2178 var kScopeDetailsObjectIndex = 1; |
2179 var kScopeDetailsNameIndex = 2; | 2179 var kScopeDetailsNameIndex = 2; |
| 2180 var kScopeDetailsStartPositionIndex = 3; |
| 2181 var kScopeDetailsEndPositionIndex = 4; |
| 2182 var kScopeDetailsFunctionIndex = 5; |
2180 | 2183 |
2181 function ScopeDetails(frame, fun, index, opt_details) { | 2184 function ScopeDetails(frame, fun, index, opt_details) { |
2182 if (frame) { | 2185 if (frame) { |
2183 this.break_id_ = frame.break_id_; | 2186 this.break_id_ = frame.break_id_; |
2184 this.details_ = opt_details || | 2187 this.details_ = opt_details || |
2185 %GetScopeDetails(frame.break_id_, | 2188 %GetScopeDetails(frame.break_id_, |
2186 frame.details_.frameId(), | 2189 frame.details_.frameId(), |
2187 frame.details_.inlinedFrameIndex(), | 2190 frame.details_.inlinedFrameIndex(), |
2188 index); | 2191 index); |
2189 this.frame_id_ = frame.details_.frameId(); | 2192 this.frame_id_ = frame.details_.frameId(); |
(...skipping 24 matching lines...) Expand all Loading... |
2214 | 2217 |
2215 | 2218 |
2216 ScopeDetails.prototype.name = function() { | 2219 ScopeDetails.prototype.name = function() { |
2217 if (!IS_UNDEFINED(this.break_id_)) { | 2220 if (!IS_UNDEFINED(this.break_id_)) { |
2218 %CheckExecutionState(this.break_id_); | 2221 %CheckExecutionState(this.break_id_); |
2219 } | 2222 } |
2220 return this.details_[kScopeDetailsNameIndex]; | 2223 return this.details_[kScopeDetailsNameIndex]; |
2221 }; | 2224 }; |
2222 | 2225 |
2223 | 2226 |
| 2227 ScopeDetails.prototype.startPosition = function() { |
| 2228 if (!IS_UNDEFINED(this.break_id_)) { |
| 2229 %CheckExecutionState(this.break_id_); |
| 2230 } |
| 2231 return this.details_[kScopeDetailsStartPositionIndex]; |
| 2232 } |
| 2233 |
| 2234 |
| 2235 ScopeDetails.prototype.endPosition = function() { |
| 2236 if (!IS_UNDEFINED(this.break_id_)) { |
| 2237 %CheckExecutionState(this.break_id_); |
| 2238 } |
| 2239 return this.details_[kScopeDetailsEndPositionIndex]; |
| 2240 } |
| 2241 |
| 2242 ScopeDetails.prototype.func = function() { |
| 2243 if (!IS_UNDEFINED(this.break_id_)) { |
| 2244 %CheckExecutionState(this.break_id_); |
| 2245 } |
| 2246 return this.details_[kScopeDetailsFunctionIndex]; |
| 2247 } |
| 2248 |
| 2249 |
2224 ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) { | 2250 ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) { |
2225 var raw_res; | 2251 var raw_res; |
2226 if (!IS_UNDEFINED(this.break_id_)) { | 2252 if (!IS_UNDEFINED(this.break_id_)) { |
2227 %CheckExecutionState(this.break_id_); | 2253 %CheckExecutionState(this.break_id_); |
2228 raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_, | 2254 raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_, |
2229 this.inlined_frame_id_, this.index_, name, new_value); | 2255 this.inlined_frame_id_, this.index_, name, new_value); |
2230 } else { | 2256 } else { |
2231 raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_, | 2257 raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_, |
2232 name, new_value); | 2258 name, new_value); |
2233 } | 2259 } |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 // Functions needed by the debugger runtime. | 3070 // Functions needed by the debugger runtime. |
3045 utils.InstallFunctions(utils, DONT_ENUM, [ | 3071 utils.InstallFunctions(utils, DONT_ENUM, [ |
3046 "ClearMirrorCache", ClearMirrorCache | 3072 "ClearMirrorCache", ClearMirrorCache |
3047 ]); | 3073 ]); |
3048 | 3074 |
3049 // Export to debug.js | 3075 // Export to debug.js |
3050 utils.Export(function(to) { | 3076 utils.Export(function(to) { |
3051 to.MirrorType = MirrorType; | 3077 to.MirrorType = MirrorType; |
3052 }); | 3078 }); |
3053 }) | 3079 }) |
OLD | NEW |