Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure the breakpoints panel is updated

  • Loading branch information...
commit a15837a4950fce1bca9fe2c53d132f3c7186a3c7 1 parent ada19c9
@janodvarko janodvarko authored
View
20 extension/content/firebug/debugger/debuggerClient.js
@@ -32,7 +32,7 @@ function DebuggerClient(context, connection)
this.onThreadStateListener = this.onThreadState.bind(this);
}
-DebuggerClient.prototype = Obj.extend(Object,
+DebuggerClient.prototype = Obj.extend(new Firebug.EventSource(),
{
dispatchName: "DebuggerClient",
@@ -149,7 +149,7 @@ DebuggerClient.prototype = Obj.extend(Object,
this.activeThread = threadClient;
// Connect script manager
- this.scripts = new SourceScripts(this.connection, this.activeThread);
+ this.scripts = new SourceScripts(this);
this.scripts.connect();
// Resume remote thread.
@@ -192,10 +192,11 @@ DebuggerClient.prototype = Obj.extend(Object,
* Keeps the source script list up-to-date, using the thread client's
* source script cache.
*/
-function SourceScripts(connection, thread)
+function SourceScripts(debuggerClient)
{
- this.connection = connection;
- this.thread = thread;
+ this.debuggerClient = debuggerClient;
+ this.connection = debuggerClient.connection;
+ this.thread = debuggerClient.activeThread;
}
SourceScripts.prototype =
@@ -207,11 +208,16 @@ SourceScripts.prototype =
// Retrieve the list of scripts known to the server from before the client
// was ready to handle new script notifications.
this.thread.fillScripts();
+
+ this.onNewScript = this.onNewScript.bind();
+
+ this.debuggerClient.addListener("newScript", this.onNewScript);
},
disconnect: function()
{
-
+ this.thread.removeListener(this);
+ this.debuggerClient.removeListener("newScript", this.onNewScript);
},
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -228,6 +234,8 @@ SourceScripts.prototype =
onScriptsAdded: function(scriptCache)
{
+ FBTrace.sysout("SourceScripts.onScriptsAdded; ", scriptCache);
+
for (var p in scriptCache)
{
var script = scriptCache[p];
View
26 extension/content/firebug/debugger/scriptPanel.js
@@ -11,9 +11,11 @@ define([
"firebug/chrome/menu",
"firebug/debugger/stackFrame",
"firebug/debugger/sourceLink",
+ "firebug/debugger/breakpoint",
+ "firebug/debugger/breakpointStore",
],
function (Obj, Locale, Events, Dom, ScriptView, CompilationUnit, DebuggerTool, Menu,
- StackFrame, SourceLink) {
+ StackFrame, SourceLink, Breakpoint, BreakpointStore) {
// ********************************************************************************************* //
// Script panel
@@ -306,13 +308,27 @@ ScriptPanel.prototype = Obj.extend(BasePanel,
onBreakpointAdd: function(bp)
{
- var self = this;
- function callback()
+ var url = this.location.href;
+ var line = bp.line;
+
+ function callback(response)
{
- FBTrace.sysout("scriptPanel.onBreakpointAdd; breakpoint added", arguments);
+ if (response.error)
+ {
+ if (FBTrace.DBG_ERRORS)
+ FBTrace.sysout("scriptPanel.onBreakpointAdd; ERROR " + response, response);
+ return;
+ }
+
+ // Persist the breakpoint on the client side
+ BreakpointStore.addBreakpoint(url, line, {actor: response.actor});
+
+ if (FBTrace.DBG_BP)
+ FBTrace.sysout("scriptPanel.onBreakpointAdd; breakpoint added", bp);
}
- this.tool.setBreakpoint(this.context, this.location.href, bp.line, callback);
+ FBTrace.sysout("scriptPanel.onBreakpointAdd; set a breakpoint", bp);
+ this.tool.setBreakpoint(this.context, url, line, callback);
},
onBreakpointRemove: function(bp)
View
8 extension/content/firebug/debugger/threadClient.js
@@ -275,13 +275,13 @@ ThreadClient.prototype = Obj.extend(new Firebug.EventSource(),
// dead script that will reappear on a page reload.
if (onResponse)
{
- var bpClient = new BreakpointClient(this.connection, response.actor,
- location);
+ //var bpClient = new BreakpointClient(this.connection, response.actor,
+ // location);
if (callback)
- callback(onResponse(response, bpClient));
+ callback(onResponse(response));
else
- onResponse(response, bpClient);
+ onResponse(response);
}
}.bind(this));
}.bind(this);
Please sign in to comment.
Something went wrong with that request. Please try again.