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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); | 57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); |
58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._profilingStateChanged, this); | 58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._profilingStateChanged, this); |
59 | 59 |
60 this.enableDebugger(); | 60 this.enableDebugger(); |
61 | 61 |
62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); | 62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); |
63 this._applySkipStackFrameSettings(); | 63 this._applySkipStackFrameSettings(); |
64 } | 64 } |
65 | 65 |
66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: str
ing, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ | 66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ |
67 WebInspector.DebuggerModel.FunctionDetails; | 67 WebInspector.DebuggerModel.FunctionDetails; |
68 | 68 |
69 /** | 69 /** |
70 * Keep these in sync with WebCore::ScriptDebugServer | 70 * Keep these in sync with WebCore::ScriptDebugServer |
71 * | 71 * |
72 * @enum {string} | 72 * @enum {string} |
73 */ | 73 */ |
74 WebInspector.DebuggerModel.PauseOnExceptionsState = { | 74 WebInspector.DebuggerModel.PauseOnExceptionsState = { |
75 DontPauseOnExceptions : "none", | 75 DontPauseOnExceptions : "none", |
76 PauseOnAllExceptions : "all", | 76 PauseOnAllExceptions : "all", |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 continue; | 557 continue; |
558 if (script.endLine < lineNumber || (script.endLine === lineNumber &&
script.endColumn <= columnNumber)) | 558 if (script.endLine < lineNumber || (script.endLine === lineNumber &&
script.endColumn <= columnNumber)) |
559 continue; | 559 continue; |
560 closestScript = script; | 560 closestScript = script; |
561 break; | 561 break; |
562 } | 562 } |
563 return closestScript ? new WebInspector.DebuggerModel.Location(this.targ
et(), closestScript.scriptId, lineNumber, columnNumber) : null; | 563 return closestScript ? new WebInspector.DebuggerModel.Location(this.targ
et(), closestScript.scriptId, lineNumber, columnNumber) : null; |
564 }, | 564 }, |
565 | 565 |
566 /** | 566 /** |
567 * @param {!DebuggerAgent.ScriptId} scriptId | 567 * @param {?DebuggerAgent.ScriptId} scriptId |
568 * @param {string} sourceUrl | 568 * @param {string} sourceUrl |
569 * @param {number} lineNumber | 569 * @param {number} lineNumber |
570 * @param {number} columnNumber | 570 * @param {number} columnNumber |
571 * @return {?WebInspector.DebuggerModel.Location} | 571 * @return {?WebInspector.DebuggerModel.Location} |
572 */ | 572 */ |
573 createRawLocationByScriptId: function(scriptId, sourceUrl, lineNumber, colum
nNumber) | 573 createRawLocationByScriptId: function(scriptId, sourceUrl, lineNumber, colum
nNumber) |
574 { | 574 { |
575 var script = this.scriptForId(scriptId); | 575 var script = scriptId ? this.scriptForId(scriptId) : null; |
576 return script ? this.createRawLocation(script, lineNumber, columnNumber)
: this.createRawLocationByURL(sourceUrl, lineNumber, columnNumber); | 576 return script ? this.createRawLocation(script, lineNumber, columnNumber)
: this.createRawLocationByURL(sourceUrl, lineNumber, columnNumber); |
577 }, | 577 }, |
578 | 578 |
579 /** | 579 /** |
580 * @param {!ConsoleAgent.CallFrame} callFrame | 580 * @param {!ConsoleAgent.CallFrame} callFrame |
581 * @return {!WebInspector.DebuggerModel.Location} | 581 * @return {!WebInspector.DebuggerModel.Location} |
582 */ | 582 */ |
583 createRawLocationByConsoleCallFrame: function(callFrame) | 583 createRawLocationByConsoleCallFrame: function(callFrame) |
584 { | 584 { |
585 // FIXME(62725): console stack trace line/column numbers are one-based. | 585 // FIXME(62725): console stack trace line/column numbers are one-based. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 function didGetDetails(error, response) | 747 function didGetDetails(error, response) |
748 { | 748 { |
749 if (error) { | 749 if (error) { |
750 console.error(error); | 750 console.error(error); |
751 callback(null); | 751 callback(null); |
752 return; | 752 return; |
753 } | 753 } |
754 var location = response.location; | 754 var location = response.location; |
755 var script = this.scriptForId(location.scriptId); | 755 var script = this.scriptForId(location.scriptId); |
756 var rawLocation = script ? this.createRawLocation(script, location.l
ineNumber + 1, location.columnNumber + 1) : null; | 756 var rawLocation = script ? this.createRawLocation(script, location.l
ineNumber + 1, location.columnNumber + 1) : null; |
757 callback({location: rawLocation, functionName: response.functionName
, scopeChain: response.scopeChain || null}); | 757 var sourceURL = script ? script.contentURL() : null; |
| 758 callback({location: rawLocation, sourceURL: sourceURL, functionName:
response.functionName, scopeChain: response.scopeChain || null}); |
758 } | 759 } |
759 }, | 760 }, |
760 | 761 |
761 /** | 762 /** |
762 * @param {!DebuggerAgent.BreakpointId} breakpointId | 763 * @param {!DebuggerAgent.BreakpointId} breakpointId |
763 * @param {function(!WebInspector.Event)} listener | 764 * @param {function(!WebInspector.Event)} listener |
764 * @param {!Object=} thisObject | 765 * @param {!Object=} thisObject |
765 */ | 766 */ |
766 addBreakpointListener: function(breakpointId, listener, thisObject) | 767 addBreakpointListener: function(breakpointId, listener, thisObject) |
767 { | 768 { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 this.asyncStackTrace.dispose(); | 1210 this.asyncStackTrace.dispose(); |
1210 }, | 1211 }, |
1211 | 1212 |
1212 __proto__: WebInspector.SDKObject.prototype | 1213 __proto__: WebInspector.SDKObject.prototype |
1213 } | 1214 } |
1214 | 1215 |
1215 /** | 1216 /** |
1216 * @type {!WebInspector.DebuggerModel} | 1217 * @type {!WebInspector.DebuggerModel} |
1217 */ | 1218 */ |
1218 WebInspector.debuggerModel; | 1219 WebInspector.debuggerModel; |
OLD | NEW |