Permalink
Browse files

Adds scaffolding to start debugger implementation

  • Loading branch information...
1 parent a9149df commit d223b4a3ce30ee60c3dc0bfc8171bb9369fedcf6 @c4milo committed May 16, 2012
Showing with 83 additions and 486 deletions.
  1. +9 −6 index.js
  2. +0 −470 lib/debugger.js
  3. +13 −0 lib/debugger/debugger-client.js
  4. +18 −7 lib/debugger/index.js
  5. +6 −0 lib/debugger/translator.js
  6. +1 −1 lib/index.js
  7. +36 −2 webkit-devtools-agent.js
View
@@ -17,6 +17,9 @@ var DevToolsAgent = function() {
var spawnProxy = function() {
var self = this;
+ //Parent PID for the proxy to know to whom to send the SIGUSR1 signal
+ process.env.PARENT_PID = process.pid;
+
this.proxy = spawn(__dirname + '/webkit-devtools-agent.js', process.argv, {
env: process.env,
cwd: __dirname
@@ -51,7 +54,6 @@ var DevToolsAgent = function() {
try {
data = JSON.parse(message);
} catch(e) {
- console.log(e);
console.log(e.stack);
return;
}
@@ -77,13 +79,14 @@ var DevToolsAgent = function() {
});
}.bind(this);
+ var sendEvent = function(data) {
+ if (!this.socket) return;
+ this.socket.send(JSON.stringify(data));
+ }.bind(this);
+
var loadAgents = function() {
var self = this;
- var sendEvent = function(data) {
- self.socket.send(JSON.stringify(data));
- };
-
var runtimeAgent = new agents.Runtime(sendEvent);
this.agents = {};
@@ -156,7 +159,7 @@ if (!module.parent) {
['exit', 'uncaughtException'].forEach(function(e) {
process.on(e, function(e) {
if (e) {
- console.log(e);
+ console.error(e.stack);
}
nodeAgent.stop();
});
Oops, something went wrong.

0 comments on commit d223b4a

Please sign in to comment.