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

Side by Side Diff: src/debug-delay.js

Issue 13382: Add handling of empty stack in the backtrace debug request.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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 | « no previous file | no next file » | 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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 ExceptionEvent.prototype.executionState = function() { 825 ExceptionEvent.prototype.executionState = function() {
826 return this.exec_state_; 826 return this.exec_state_;
827 }; 827 };
828 828
829 829
830 ExceptionEvent.prototype.eventType = function() { 830 ExceptionEvent.prototype.eventType = function() {
831 return Debug.DebugEvent.Exception; 831 return Debug.DebugEvent.Exception;
832 }; 832 };
833 833
834 834
835 ExceptionEvent.prototype.exception = function() {
836 return this.exception_;
837 }
838
839
835 ExceptionEvent.prototype.uncaught = function() { 840 ExceptionEvent.prototype.uncaught = function() {
836 return this.uncaught_; 841 return this.uncaught_;
837 } 842 }
838 843
844
839 ExceptionEvent.prototype.func = function() { 845 ExceptionEvent.prototype.func = function() {
840 return this.exec_state_.frame(0).func(); 846 return this.exec_state_.frame(0).func();
841 }; 847 };
842 848
843 849
844 ExceptionEvent.prototype.sourceLine = function() { 850 ExceptionEvent.prototype.sourceLine = function() {
845 return this.exec_state_.frame(0).sourceLine(); 851 return this.exec_state_.frame(0).sourceLine();
846 }; 852 };
847 853
848 854
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 1321
1316 // Clear break point. 1322 // Clear break point.
1317 Debug.clearBreakPoint(break_point); 1323 Debug.clearBreakPoint(break_point);
1318 } 1324 }
1319 1325
1320 1326
1321 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) { 1327 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) {
1322 // Get the number of frames. 1328 // Get the number of frames.
1323 var total_frames = this.exec_state_.frameCount(); 1329 var total_frames = this.exec_state_.frameCount();
1324 1330
1331 // Create simple response if there are no frames.
1332 if (total_frames == 0) {
1333 response.body = {
1334 totalFrames: total_frames
1335 }
1336 return;
1337 }
1338
1325 // Default frame range to include in backtrace. 1339 // Default frame range to include in backtrace.
1326 var from_index = 0 1340 var from_index = 0
1327 var to_index = kDefaultBacktraceLength; 1341 var to_index = kDefaultBacktraceLength;
1328 1342
1329 // Get the range from the arguments. 1343 // Get the range from the arguments.
1330 if (request.arguments) { 1344 if (request.arguments) {
1331 from_index = request.arguments.fromFrame; 1345 from_index = request.arguments.fromFrame;
1332 if (from_index < 0) { 1346 if (from_index < 0) {
1333 return response.failed('Invalid frame number'); 1347 return response.failed('Invalid frame number');
1334 } 1348 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 json += NumberToJSON_(elem); 1654 json += NumberToJSON_(elem);
1641 } else if (IS_STRING(elem)) { 1655 } else if (IS_STRING(elem)) {
1642 json += StringToJSON_(elem); 1656 json += StringToJSON_(elem);
1643 } else { 1657 } else {
1644 json += elem; 1658 json += elem;
1645 } 1659 }
1646 } 1660 }
1647 json += ']'; 1661 json += ']';
1648 return json; 1662 return json;
1649 } 1663 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698