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

Unified Diff: webkit/glue/devtools/js/debugger_agent.js

Issue 149329: DevTools: handle call frames with unresolved script sources upon exception br... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/debugger_agent.js
===================================================================
--- webkit/glue/devtools/js/debugger_agent.js (revision 20146)
+++ webkit/glue/devtools/js/debugger_agent.js (working copy)
@@ -150,7 +150,7 @@
devtools.DebuggerAgent.prototype.resolveScriptSource = function(
scriptId, callback) {
var script = this.parsedScripts_[scriptId];
- if (!script) {
+ if (!script || script.unresolved) {
callback(null);
return;
}
@@ -798,7 +798,7 @@
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 @@
/**
* @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 @@
* @param {string} contextType Type of the script's context:
* "page" - regular script from html page
* "injected" - extension content script
+ * @param {bool} opt_unresolved If true, script will not be resolved.
* @constructor
*/
-devtools.ScriptInfo = function(scriptId, url, lineOffset, contextType) {
+devtools.ScriptInfo = function(
+ scriptId, url, lineOffset, contextType, opt_unresolved) {
this.scriptId_ = scriptId;
this.lineOffset_ = lineOffset;
this.contextType_ = contextType;
this.url_ = url;
+ this.unresolved = opt_unresolved;
yurys 2009/07/08 15:27:46 please make it private and define getter
pfeldman 2009/07/08 15:31:52 Done.
this.lineToBreakpointInfo_ = {};
};
« 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