Bug 942756 - Unify debugger server startup: fix HUD. r=fabrice

This commit is contained in:
Paul Rouget 2014-04-24 10:43:00 -04:00
parent 1a7cdd2eef
commit 54851b2e41
2 changed files with 11 additions and 8 deletions

View File

@ -15,6 +15,10 @@ XPCOMUtils.defineLazyGetter(this, 'DebuggerClient', function() {
return Cu.import('resource://gre/modules/devtools/dbg-client.jsm', {}).DebuggerClient;
});
XPCOMUtils.defineLazyGetter(this, 'DebuggerServer', function() {
return Cu.import('resource://gre/modules/devtools/dbg-server.jsm', {}).DebuggerServer;
});
XPCOMUtils.defineLazyGetter(this, 'WebConsoleUtils', function() {
return devtools.require('devtools/toolkit/webconsole/utils').Utils;
});
@ -58,7 +62,7 @@ let developerHUD = {
return;
if (!DebuggerServer.initialized) {
RemoteDebugger.start();
DebuggerServer.controller.start(null);
}
// We instantiate a local debugger connection so that watchers can use our

View File

@ -80,9 +80,6 @@ DebuggerServerController.prototype = {
// nsIDebuggerController
start: function(portOrPath) {
if (!portOrPath) {
throw new Error("No TCP port or unix socket path specified.");
}
if (!this.debugger.initialized) {
// Ask for remote connections.
@ -133,10 +130,12 @@ DebuggerServerController.prototype = {
}
try {
this.debugger.openListener(portOrPath);
} catch (e) {
dump("Unable to start debugger server (" + portOrPath + "): " + e + "\n");
if (portOrPath) {
try {
this.debugger.openListener(portOrPath);
} catch (e) {
dump("Unable to start debugger server (" + portOrPath + "): " + e + "\n");
}
}
},