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

Side by Side Diff: src/mirror-debugger.js

Issue 15960016: Provide list of step-in source positions in JS Debug API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 7 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
« no previous file with comments | « src/debug.cc ('k') | src/runtime.h » ('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 2006-2012 the V8 project authors. All rights reserved. 1 // Copyright 2006-2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 return this.details_[return_value_offset]; 1502 return this.details_[return_value_offset];
1503 } 1503 }
1504 }; 1504 };
1505 1505
1506 1506
1507 FrameDetails.prototype.scopeCount = function() { 1507 FrameDetails.prototype.scopeCount = function() {
1508 return %GetScopeCount(this.break_id_, this.frameId()); 1508 return %GetScopeCount(this.break_id_, this.frameId());
1509 }; 1509 };
1510 1510
1511 1511
1512 FrameDetails.prototype.stepInPositionsImpl = function() {
1513 return %GetStepInPositions(this.break_id_, this.frameId());
1514 };
1515
1516
1512 /** 1517 /**
1513 * Mirror object for stack frames. 1518 * Mirror object for stack frames.
1514 * @param {number} break_id The break id in the VM for which this frame is 1519 * @param {number} break_id The break id in the VM for which this frame is
1515 valid 1520 valid
1516 * @param {number} index The frame index (top frame is index 0) 1521 * @param {number} index The frame index (top frame is index 0)
1517 * @constructor 1522 * @constructor
1518 * @extends Mirror 1523 * @extends Mirror
1519 */ 1524 */
1520 function FrameMirror(break_id, index) { 1525 function FrameMirror(break_id, index) {
1521 %_CallFunction(this, FRAME_TYPE, Mirror); 1526 %_CallFunction(this, FRAME_TYPE, Mirror);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 FrameMirror.prototype.scopeCount = function() { 1667 FrameMirror.prototype.scopeCount = function() {
1663 return this.details_.scopeCount(); 1668 return this.details_.scopeCount();
1664 }; 1669 };
1665 1670
1666 1671
1667 FrameMirror.prototype.scope = function(index) { 1672 FrameMirror.prototype.scope = function(index) {
1668 return new ScopeMirror(this, void 0, index); 1673 return new ScopeMirror(this, void 0, index);
1669 }; 1674 };
1670 1675
1671 1676
1677 FrameMirror.prototype.stepInPositions = function() {
1678 var script = this.func().script();
1679 var funcOffset = this.func().sourcePosition_();
1680
1681 var stepInRaw = this.details_.stepInPositionsImpl();
1682 var result = [];
1683 if (stepInRaw) {
1684 for (var i = 0; i < stepInRaw.length; i++) {
1685 var posStruct = {};
1686 var offset = script.locationFromPosition(funcOffset + stepInRaw[i],
1687 true);
1688 serializeLocationFields(offset, posStruct);
1689 var item = {
1690 position: posStruct
1691 };
1692 result.push(item);
1693 }
1694 }
1695
1696 return result;
1697 };
1698
1699
1672 FrameMirror.prototype.evaluate = function(source, disable_break, 1700 FrameMirror.prototype.evaluate = function(source, disable_break,
1673 opt_context_object) { 1701 opt_context_object) {
1674 var result = %DebugEvaluate(this.break_id_, 1702 var result = %DebugEvaluate(this.break_id_,
1675 this.details_.frameId(), 1703 this.details_.frameId(),
1676 this.details_.inlinedFrameIndex(), 1704 this.details_.inlinedFrameIndex(),
1677 source, 1705 source,
1678 Boolean(disable_break), 1706 Boolean(disable_break),
1679 opt_context_object); 1707 opt_context_object);
1680 return MakeMirror(result); 1708 return MakeMirror(result);
1681 }; 1709 };
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 } 2645 }
2618 if (!NUMBER_IS_FINITE(value)) { 2646 if (!NUMBER_IS_FINITE(value)) {
2619 if (value > 0) { 2647 if (value > 0) {
2620 return 'Infinity'; 2648 return 'Infinity';
2621 } else { 2649 } else {
2622 return '-Infinity'; 2650 return '-Infinity';
2623 } 2651 }
2624 } 2652 }
2625 return value; 2653 return value;
2626 } 2654 }
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698