OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 this._scripts[scriptId].editSource(newSource, this._didEditScriptSource.
bind(this, scriptId, newSource, callback)); | 385 this._scripts[scriptId].editSource(newSource, this._didEditScriptSource.
bind(this, scriptId, newSource, callback)); |
386 }, | 386 }, |
387 | 387 |
388 /** | 388 /** |
389 * @param {DebuggerAgent.ScriptId} scriptId | 389 * @param {DebuggerAgent.ScriptId} scriptId |
390 * @param {string} newSource | 390 * @param {string} newSource |
391 * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=)} c
allback | 391 * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=)} c
allback |
392 * @param {?Protocol.Error} error | 392 * @param {?Protocol.Error} error |
393 * @param {DebuggerAgent.SetScriptSourceError=} errorData | 393 * @param {DebuggerAgent.SetScriptSourceError=} errorData |
394 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames | 394 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames |
| 395 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
395 * @param {boolean=} needsStepIn | 396 * @param {boolean=} needsStepIn |
396 */ | 397 */ |
397 _didEditScriptSource: function(scriptId, newSource, callback, error, errorDa
ta, callFrames, needsStepIn) | 398 _didEditScriptSource: function(scriptId, newSource, callback, error, errorDa
ta, callFrames, asyncStackTrace, needsStepIn) |
398 { | 399 { |
399 callback(error, errorData); | 400 callback(error, errorData); |
400 if (needsStepIn) | 401 if (needsStepIn) |
401 this.stepInto(); | 402 this.stepInto(); |
402 else if (!error && callFrames && callFrames.length) | 403 else if (!error && callFrames && callFrames.length) |
403 this._pausedScript(callFrames, this._debuggerPausedDetails.reason, t
his._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds); | 404 this._pausedScript(callFrames, this._debuggerPausedDetails.reason, t
his._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds, a
syncStackTrace); |
404 }, | 405 }, |
405 | 406 |
406 /** | 407 /** |
407 * @return {?Array.<WebInspector.DebuggerModel.CallFrame>} | 408 * @return {?Array.<WebInspector.DebuggerModel.CallFrame>} |
408 */ | 409 */ |
409 get callFrames() | 410 get callFrames() |
410 { | 411 { |
411 return this._debuggerPausedDetails ? this._debuggerPausedDetails.callFra
mes : null; | 412 return this._debuggerPausedDetails ? this._debuggerPausedDetails.callFra
mes : null; |
412 }, | 413 }, |
413 | 414 |
(...skipping 22 matching lines...) Expand all Loading... |
436 this.setSelectedCallFrame(null); | 437 this.setSelectedCallFrame(null); |
437 DebuggerAgent.setOverlayMessage(); | 438 DebuggerAgent.setOverlayMessage(); |
438 } | 439 } |
439 }, | 440 }, |
440 | 441 |
441 /** | 442 /** |
442 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames | 443 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames |
443 * @param {string} reason | 444 * @param {string} reason |
444 * @param {Object|undefined} auxData | 445 * @param {Object|undefined} auxData |
445 * @param {!Array.<string>} breakpointIds | 446 * @param {!Array.<string>} breakpointIds |
| 447 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
446 */ | 448 */ |
447 _pausedScript: function(callFrames, reason, auxData, breakpointIds) | 449 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) |
448 { | 450 { |
449 if (this._pendingStepIntoLocation) { | 451 if (this._pendingStepIntoLocation) { |
450 var requestedLocation = this._pendingStepIntoLocation; | 452 var requestedLocation = this._pendingStepIntoLocation; |
451 delete this._pendingStepIntoLocation; | 453 delete this._pendingStepIntoLocation; |
452 | 454 |
453 if (callFrames.length > 0) { | 455 if (callFrames.length > 0) { |
454 var topLocation = callFrames[0].location; | 456 var topLocation = callFrames[0].location; |
455 if (topLocation.lineNumber == requestedLocation.lineNumber && to
pLocation.columnNumber == requestedLocation.columnNumber && topLocation.scriptId
== requestedLocation.scriptId) { | 457 if (topLocation.lineNumber == requestedLocation.lineNumber && to
pLocation.columnNumber == requestedLocation.columnNumber && topLocation.scriptId
== requestedLocation.scriptId) { |
456 this.stepInto(); | 458 this.stepInto(); |
457 return; | 459 return; |
458 } | 460 } |
459 } | 461 } |
460 } | 462 } |
461 | 463 |
462 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is, callFrames, reason, auxData, breakpointIds)); | 464 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is, callFrames, reason, auxData, breakpointIds, asyncStackTrace)); |
463 }, | 465 }, |
464 | 466 |
465 _resumedScript: function() | 467 _resumedScript: function() |
466 { | 468 { |
467 this._setDebuggerPausedDetails(null); | 469 this._setDebuggerPausedDetails(null); |
468 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
Resumed); | 470 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
Resumed); |
469 }, | 471 }, |
470 | 472 |
471 /** | 473 /** |
472 * @param {DebuggerAgent.ScriptId} scriptId | 474 * @param {DebuggerAgent.ScriptId} scriptId |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 if (!script) | 678 if (!script) |
677 return null; | 679 return null; |
678 return script.rawLocationToUILocation(rawLocation.lineNumber, rawLocatio
n.columnNumber); | 680 return script.rawLocationToUILocation(rawLocation.lineNumber, rawLocatio
n.columnNumber); |
679 }, | 681 }, |
680 | 682 |
681 /** | 683 /** |
682 * Handles notification from JavaScript VM about updated stack (liveedit or
frame restart action). | 684 * Handles notification from JavaScript VM about updated stack (liveedit or
frame restart action). |
683 * @this {WebInspector.DebuggerModel} | 685 * @this {WebInspector.DebuggerModel} |
684 * @param {!Array.<DebuggerAgent.CallFrame>=} newCallFrames | 686 * @param {!Array.<DebuggerAgent.CallFrame>=} newCallFrames |
685 * @param {Object=} details | 687 * @param {Object=} details |
| 688 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
686 */ | 689 */ |
687 callStackModified: function(newCallFrames, details) | 690 callStackModified: function(newCallFrames, details, asyncStackTrace) |
688 { | 691 { |
689 // FIXME: declare this property in protocol and in JavaScript. | 692 // FIXME: declare this property in protocol and in JavaScript. |
690 if (details && details["stack_update_needs_step_in"]) | 693 if (details && details["stack_update_needs_step_in"]) |
691 this.stepInto(); | 694 this.stepInto(); |
692 else { | 695 else if (newCallFrames && newCallFrames.length) |
693 if (newCallFrames && newCallFrames.length) | 696 this._pausedScript(newCallFrames, this._debuggerPausedDetails.reason
, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds
, asyncStackTrace); |
694 this._pausedScript(newCallFrames, this._debuggerPausedDetails.re
ason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpoin
tIds); | |
695 | |
696 } | |
697 }, | 697 }, |
698 | 698 |
699 __proto__: WebInspector.Object.prototype | 699 __proto__: WebInspector.Object.prototype |
700 } | 700 } |
701 | 701 |
702 WebInspector.DebuggerModel.applySkipStackFrameSettings = function() | 702 WebInspector.DebuggerModel.applySkipStackFrameSettings = function() |
703 { | 703 { |
704 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabled()
) | 704 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabled()
) |
705 return; | 705 return; |
706 var settings = WebInspector.settings; | 706 var settings = WebInspector.settings; |
(...skipping 16 matching lines...) Expand all Loading... |
723 { | 723 { |
724 this._debuggerModel = debuggerModel; | 724 this._debuggerModel = debuggerModel; |
725 } | 725 } |
726 | 726 |
727 WebInspector.DebuggerDispatcher.prototype = { | 727 WebInspector.DebuggerDispatcher.prototype = { |
728 /** | 728 /** |
729 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames | 729 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames |
730 * @param {string} reason | 730 * @param {string} reason |
731 * @param {Object=} auxData | 731 * @param {Object=} auxData |
732 * @param {!Array.<string>=} breakpointIds | 732 * @param {!Array.<string>=} breakpointIds |
| 733 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
733 */ | 734 */ |
734 paused: function(callFrames, reason, auxData, breakpointIds) | 735 paused: function(callFrames, reason, auxData, breakpointIds, asyncStackTrace
) |
735 { | 736 { |
736 this._debuggerModel._pausedScript(callFrames, reason, auxData, breakpoin
tIds || []); | 737 this._debuggerModel._pausedScript(callFrames, reason, auxData, breakpoin
tIds || [], asyncStackTrace); |
737 }, | 738 }, |
738 | 739 |
739 resumed: function() | 740 resumed: function() |
740 { | 741 { |
741 this._debuggerModel._resumedScript(); | 742 this._debuggerModel._resumedScript(); |
742 }, | 743 }, |
743 | 744 |
744 globalObjectCleared: function() | 745 globalObjectCleared: function() |
745 { | 746 { |
746 this._debuggerModel._globalObjectCleared(); | 747 this._debuggerModel._globalObjectCleared(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 /** | 894 /** |
894 * @param {function(?Protocol.Error=)=} callback | 895 * @param {function(?Protocol.Error=)=} callback |
895 */ | 896 */ |
896 restart: function(callback) | 897 restart: function(callback) |
897 { | 898 { |
898 /** | 899 /** |
899 * @this {WebInspector.DebuggerModel.CallFrame} | 900 * @this {WebInspector.DebuggerModel.CallFrame} |
900 * @param {?Protocol.Error} error | 901 * @param {?Protocol.Error} error |
901 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames | 902 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames |
902 * @param {Object=} details | 903 * @param {Object=} details |
| 904 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
903 */ | 905 */ |
904 function protocolCallback(error, callFrames, details) | 906 function protocolCallback(error, callFrames, details, asyncStackTrace) |
905 { | 907 { |
906 if (!error) | 908 if (!error) |
907 WebInspector.debuggerModel.callStackModified(callFrames, details
); | 909 WebInspector.debuggerModel.callStackModified(callFrames, details
, asyncStackTrace); |
908 if (callback) | 910 if (callback) |
909 callback(error); | 911 callback(error); |
910 } | 912 } |
911 DebuggerAgent.restartFrame(this._payload.callFrameId, protocolCallback); | 913 DebuggerAgent.restartFrame(this._payload.callFrameId, protocolCallback); |
912 }, | 914 }, |
913 | 915 |
914 /** | 916 /** |
915 * @param {function(!Array.<DebuggerAgent.Location>)} callback | 917 * @param {function(!Array.<DebuggerAgent.Location>)} callback |
916 */ | 918 */ |
917 getStepIntoLocations: function(callback) | 919 getStepIntoLocations: function(callback) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 } | 954 } |
953 } | 955 } |
954 | 956 |
955 /** | 957 /** |
956 * @constructor | 958 * @constructor |
957 * @param {WebInspector.DebuggerModel} model | 959 * @param {WebInspector.DebuggerModel} model |
958 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames | 960 * @param {!Array.<DebuggerAgent.CallFrame>} callFrames |
959 * @param {string} reason | 961 * @param {string} reason |
960 * @param {Object|undefined} auxData | 962 * @param {Object|undefined} auxData |
961 * @param {!Array.<string>} breakpointIds | 963 * @param {!Array.<string>} breakpointIds |
| 964 * @param {DebuggerAgent.StackTrace=} asyncStackTrace |
962 */ | 965 */ |
963 WebInspector.DebuggerPausedDetails = function(model, callFrames, reason, auxData
, breakpointIds) | 966 WebInspector.DebuggerPausedDetails = function(model, callFrames, reason, auxData
, breakpointIds, asyncStackTrace) |
964 { | 967 { |
965 this.callFrames = []; | 968 this.callFrames = []; |
966 for (var i = 0; i < callFrames.length; ++i) { | 969 for (var i = 0; i < callFrames.length; ++i) { |
967 var callFrame = callFrames[i]; | 970 var callFrame = callFrames[i]; |
968 var script = model.scriptForId(callFrame.location.scriptId); | 971 var script = model.scriptForId(callFrame.location.scriptId); |
969 if (script) | 972 if (script) |
970 this.callFrames.push(new WebInspector.DebuggerModel.CallFrame(script
, callFrame)); | 973 this.callFrames.push(new WebInspector.DebuggerModel.CallFrame(script
, callFrame)); |
971 } | 974 } |
972 this.reason = reason; | 975 this.reason = reason; |
973 this.auxData = auxData; | 976 this.auxData = auxData; |
974 this.breakpointIds = breakpointIds; | 977 this.breakpointIds = breakpointIds; |
| 978 this.asyncStackTrace = asyncStackTrace; |
975 } | 979 } |
976 | 980 |
977 WebInspector.DebuggerPausedDetails.prototype = { | 981 WebInspector.DebuggerPausedDetails.prototype = { |
978 dispose: function() | 982 dispose: function() |
979 { | 983 { |
980 for (var i = 0; i < this.callFrames.length; ++i) { | 984 for (var i = 0; i < this.callFrames.length; ++i) { |
981 var callFrame = this.callFrames[i]; | 985 var callFrame = this.callFrames[i]; |
982 callFrame.dispose(); | 986 callFrame.dispose(); |
983 } | 987 } |
984 } | 988 } |
985 } | 989 } |
986 | 990 |
987 /** | 991 /** |
988 * @type {?WebInspector.DebuggerModel} | 992 * @type {?WebInspector.DebuggerModel} |
989 */ | 993 */ |
990 WebInspector.debuggerModel = null; | 994 WebInspector.debuggerModel = null; |
OLD | NEW |