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

Side by Side Diff: src/d8.js

Issue 21350: Better handling debug evaluation when there is no JavaScript stack (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « no previous file | src/debug-delay.js » ('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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // Build a lookup request. 374 // Build a lookup request.
375 var request = this.createRequest('lookup'); 375 var request = this.createRequest('lookup');
376 request.arguments = {}; 376 request.arguments = {};
377 request.arguments.handle = parseInt(handle_match[1]); 377 request.arguments.handle = parseInt(handle_match[1]);
378 return request.toJSONProtocol(); 378 return request.toJSONProtocol();
379 } else { 379 } else {
380 // Build an evaluate request. 380 // Build an evaluate request.
381 var request = this.createRequest('evaluate'); 381 var request = this.createRequest('evaluate');
382 request.arguments = {}; 382 request.arguments = {};
383 request.arguments.expression = expression; 383 request.arguments.expression = expression;
384 // Request a global evaluation if there is no current frame.
385 if (Debug.State.currentFrame == kNoFrame) {
386 request.arguments.global = true;
387 }
384 return request.toJSONProtocol(); 388 return request.toJSONProtocol();
385 } 389 }
386 }; 390 };
387 391
388 392
389 // Create a JSON request for the references/instances command. 393 // Create a JSON request for the references/instances command.
390 DebugRequest.prototype.makeReferencesJSONRequest_ = function(handle, type) { 394 DebugRequest.prototype.makeReferencesJSONRequest_ = function(handle, type) {
391 // Build a references request. 395 // Build a references request.
392 var handle_match = handle.match(/^#([0-9]*)#$/); 396 var handle_match = handle.match(/^#([0-9]*)#$/);
393 if (handle_match) { 397 if (handle_match) {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 case 'frame': 792 case 'frame':
789 details.text = SourceUnderline(body.sourceLineText, 793 details.text = SourceUnderline(body.sourceLineText,
790 body.column); 794 body.column);
791 Debug.State.currentSourceLine = body.line; 795 Debug.State.currentSourceLine = body.line;
792 Debug.State.currentFrame = body.index; 796 Debug.State.currentFrame = body.index;
793 break; 797 break;
794 798
795 case 'evaluate': 799 case 'evaluate':
796 case 'lookup': 800 case 'lookup':
797 if (last_cmd == 'p' || last_cmd == 'print') { 801 if (last_cmd == 'p' || last_cmd == 'print') {
798 details.text = body.text; 802 result = body.text;
799 } else { 803 } else {
800 var value = response.bodyValue(); 804 var value = response.bodyValue();
801 if (value.isObject()) { 805 if (value.isObject()) {
802 result += formatObject_(value, true); 806 result += formatObject_(value, true);
803 } else { 807 } else {
804 result += 'type: '; 808 result += 'type: ';
805 result += value.type(); 809 result += value.type();
806 if (!value.isUndefined() && !value.isNull()) { 810 if (!value.isUndefined() && !value.isNull()) {
807 result += ', '; 811 result += ', ';
808 if (value.isString()) { 812 if (value.isString()) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 return this.packet_.command; 981 return this.packet_.command;
978 } 982 }
979 983
980 984
981 ProtocolPackage.prototype.body = function() { 985 ProtocolPackage.prototype.body = function() {
982 return this.packet_.body; 986 return this.packet_.body;
983 } 987 }
984 988
985 989
986 ProtocolPackage.prototype.bodyValue = function(index) { 990 ProtocolPackage.prototype.bodyValue = function(index) {
987 if (IS_UNDEFINED(index)) { 991 if (index) {
992 return new ProtocolValue(this.packet_.body[index], this);
993 } else {
988 return new ProtocolValue(this.packet_.body, this); 994 return new ProtocolValue(this.packet_.body, this);
989 } else {
990 return new ProtocolValue(this.packet_.body[index], this);
991 } 995 }
992 } 996 }
993 997
994 998
995 ProtocolPackage.prototype.body = function() { 999 ProtocolPackage.prototype.body = function() {
996 return this.packet_.body; 1000 return this.packet_.body;
997 } 1001 }
998 1002
999 1003
1000 ProtocolPackage.prototype.lookup = function(handle) { 1004 ProtocolPackage.prototype.lookup = function(handle) {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 json += NumberToJSON_(elem); 1380 json += NumberToJSON_(elem);
1377 } else if (typeof(elem) === 'string') { 1381 } else if (typeof(elem) === 'string') {
1378 json += StringToJSON_(elem); 1382 json += StringToJSON_(elem);
1379 } else { 1383 } else {
1380 json += elem; 1384 json += elem;
1381 } 1385 }
1382 } 1386 }
1383 json += ']'; 1387 json += ']';
1384 return json; 1388 return json;
1385 } 1389 }
OLDNEW
« no previous file with comments | « no previous file | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698