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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 | 1794 |
1795 | 1795 |
1796 FrameDetails.prototype.scopeCount = function() { | 1796 FrameDetails.prototype.scopeCount = function() { |
1797 if (IS_UNDEFINED(this.scopeCount_)) { | 1797 if (IS_UNDEFINED(this.scopeCount_)) { |
1798 this.scopeCount_ = %GetScopeCount(this.break_id_, this.frameId()); | 1798 this.scopeCount_ = %GetScopeCount(this.break_id_, this.frameId()); |
1799 } | 1799 } |
1800 return this.scopeCount_; | 1800 return this.scopeCount_; |
1801 }; | 1801 }; |
1802 | 1802 |
1803 | 1803 |
1804 FrameDetails.prototype.stepInPositionsImpl = function() { | |
1805 return %GetStepInPositions(this.break_id_, this.frameId()); | |
1806 }; | |
1807 | |
1808 | |
1809 /** | 1804 /** |
1810 * Mirror object for stack frames. | 1805 * Mirror object for stack frames. |
1811 * @param {number} break_id The break id in the VM for which this frame is | 1806 * @param {number} break_id The break id in the VM for which this frame is |
1812 valid | 1807 valid |
1813 * @param {number} index The frame index (top frame is index 0) | 1808 * @param {number} index The frame index (top frame is index 0) |
1814 * @constructor | 1809 * @constructor |
1815 * @extends Mirror | 1810 * @extends Mirror |
1816 */ | 1811 */ |
1817 function FrameMirror(break_id, index) { | 1812 function FrameMirror(break_id, index) { |
1818 %_Call(Mirror, this, MirrorType.FRAME_TYPE); | 1813 %_Call(Mirror, this, MirrorType.FRAME_TYPE); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 this.details_.inlinedFrameIndex(), | 1973 this.details_.inlinedFrameIndex(), |
1979 !!opt_ignore_nested_scopes); | 1974 !!opt_ignore_nested_scopes); |
1980 var result = []; | 1975 var result = []; |
1981 for (var i = 0; i < scopeDetails.length; ++i) { | 1976 for (var i = 0; i < scopeDetails.length; ++i) { |
1982 result.push(new ScopeMirror(this, UNDEFINED, i, scopeDetails[i])); | 1977 result.push(new ScopeMirror(this, UNDEFINED, i, scopeDetails[i])); |
1983 } | 1978 } |
1984 return result; | 1979 return result; |
1985 }; | 1980 }; |
1986 | 1981 |
1987 | 1982 |
1988 FrameMirror.prototype.stepInPositions = function() { | |
1989 var script = this.func().script(); | |
1990 var funcOffset = this.func().sourcePosition_(); | |
1991 | |
1992 var stepInRaw = this.details_.stepInPositionsImpl(); | |
1993 var result = []; | |
1994 if (stepInRaw) { | |
1995 for (var i = 0; i < stepInRaw.length; i++) { | |
1996 var posStruct = {}; | |
1997 var offset = script.locationFromPosition(funcOffset + stepInRaw[i], | |
1998 true); | |
1999 serializeLocationFields(offset, posStruct); | |
2000 var item = { | |
2001 position: posStruct | |
2002 }; | |
2003 result.push(item); | |
2004 } | |
2005 } | |
2006 | |
2007 return result; | |
2008 }; | |
2009 | |
2010 | |
2011 FrameMirror.prototype.evaluate = function(source, disable_break, | 1983 FrameMirror.prototype.evaluate = function(source, disable_break, |
2012 opt_context_object) { | 1984 opt_context_object) { |
2013 return MakeMirror(%DebugEvaluate(this.break_id_, | 1985 return MakeMirror(%DebugEvaluate(this.break_id_, |
2014 this.details_.frameId(), | 1986 this.details_.frameId(), |
2015 this.details_.inlinedFrameIndex(), | 1987 this.details_.inlinedFrameIndex(), |
2016 source, | 1988 source, |
2017 TO_BOOLEAN(disable_break), | 1989 TO_BOOLEAN(disable_break), |
2018 opt_context_object)); | 1990 opt_context_object)); |
2019 }; | 1991 }; |
2020 | 1992 |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3070 // Functions needed by the debugger runtime. | 3042 // Functions needed by the debugger runtime. |
3071 utils.InstallFunctions(utils, DONT_ENUM, [ | 3043 utils.InstallFunctions(utils, DONT_ENUM, [ |
3072 "ClearMirrorCache", ClearMirrorCache | 3044 "ClearMirrorCache", ClearMirrorCache |
3073 ]); | 3045 ]); |
3074 | 3046 |
3075 // Export to debug.js | 3047 // Export to debug.js |
3076 utils.Export(function(to) { | 3048 utils.Export(function(to) { |
3077 to.MirrorType = MirrorType; | 3049 to.MirrorType = MirrorType; |
3078 }); | 3050 }); |
3079 }) | 3051 }) |
OLD | NEW |