diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 15:31:59 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 15:31:59 +0000 |
commit | e1a0c893378d37d7a1c7f145638780a2ded2530c (patch) | |
tree | 4c6143de869bcac48e7ff6f40da2207fa4d3df1b /webkit/glue | |
parent | c09a47cef0a96e98ed4c6b45cfe13da4be171ec0 (diff) | |
download | chromium_src-e1a0c893378d37d7a1c7f145638780a2ded2530c.zip chromium_src-e1a0c893378d37d7a1c7f145638780a2ded2530c.tar.gz chromium_src-e1a0c893378d37d7a1c7f145638780a2ded2530c.tar.bz2 |
DevTools: handle call frames with unresolved script sources upon exception break.
Review URL: http://codereview.chromium.org/149329
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/devtools/js/debugger_agent.js | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js index 112bb5c..aa9c77e 100644 --- a/webkit/glue/devtools/js/debugger_agent.js +++ b/webkit/glue/devtools/js/debugger_agent.js @@ -150,7 +150,7 @@ devtools.DebuggerAgent.prototype.requestScripts = function() { devtools.DebuggerAgent.prototype.resolveScriptSource = function( scriptId, callback) { var script = this.parsedScripts_[scriptId]; - if (!script) { + if (!script || script.isUnresolved()) { callback(null); return; } @@ -798,7 +798,7 @@ devtools.DebuggerAgent.prototype.handleBacktraceResponse_ = function(msg) { var frames = msg.getBody().frames; for (var i = frames.length - 1; i>=0; i--) { var nextFrame = frames[i]; - var f = devtools.DebuggerAgent.formatCallFrame_(nextFrame, script, msg); + var f = this.formatCallFrame_(nextFrame, msg); f.caller = callerFrame; callerFrame = f; } @@ -834,16 +834,20 @@ devtools.DebuggerAgent.prototype.evaluateInCallFrame_ = function(expression) { /** * @param {Object} stackFrame Frame json object from 'backtrace' response. - * @param {Object} script Script json object from 'break' event. * @param {devtools.DebuggerMessage} msg Parsed 'backtrace' response. * @return {!devtools.CallFrame} Object containing information related to the * call frame in the format expected by ScriptsPanel and its panes. */ -devtools.DebuggerAgent.formatCallFrame_ = function(stackFrame, script, msg) { - var sourceId = script.id; - +devtools.DebuggerAgent.prototype.formatCallFrame_ = function(stackFrame, msg) { var func = stackFrame.func; var sourceId = func.scriptId; + var existingScript = this.parsedScripts_[sourceId]; + if (!existingScript) { + this.parsedScripts_[sourceId] = new devtools.ScriptInfo( + sourceId, null /* name */, 0 /* line */, 'unknown' /* type */, + true /* unresolved */); + WebInspector.parsedScriptSource(sourceId, null, null, 0); + } var funcName = func.name || func.inferredName || '(anonymous function)'; var arguments = {}; @@ -998,13 +1002,16 @@ devtools.DebuggerAgent.v8ToWwebkitLineNumber_ = function(line) { * @param {string} contextType Type of the script's context: * "page" - regular script from html page * "injected" - extension content script + * @param {bool} opt_isUnresolved If true, script will not be resolved. * @constructor */ -devtools.ScriptInfo = function(scriptId, url, lineOffset, contextType) { +devtools.ScriptInfo = function( + scriptId, url, lineOffset, contextType, opt_isUnresolved) { this.scriptId_ = scriptId; this.lineOffset_ = lineOffset; this.contextType_ = contextType; this.url_ = url; + this.isUnresolved_ = opt_isUnresolved; this.lineToBreakpointInfo_ = {}; }; @@ -1035,6 +1042,14 @@ devtools.ScriptInfo.prototype.getUrl = function() { /** + * @return {?bool} + */ +devtools.ScriptInfo.prototype.isUnresolved = function() { + return this.isUnresolved_; +}; + + +/** * @param {number} line 0-based line number in the script. * @return {?devtools.BreakpointInfo} Information on a breakpoint at the * specified line in the script or undefined if there is no breakpoint at |