Browse Source

debugger: Clean up child

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
e33d0de129
  1. 17
      lib/_debugger.js

17
lib/_debugger.js

@ -7,8 +7,13 @@ exports.port = 5858;
exports.start = function () {
startInterface();
process.on('exit', function () {
if (child) child.kill();
});
};
var child;
var c;
var term;
@ -18,13 +23,11 @@ function trySpawn(cb) {
console.log(args);
var child = spawn(process.execPath, args, {
customFds: [0, 1, 2]
});
child = spawn(process.execPath, args, { customFds: [0, 1, 2] });
setTimeout(function () {
tryConnect(cb);
}, 1000);
}, 100);
}
function tryConnect(cb) {
@ -384,7 +387,11 @@ function startInterface() {
tryQuit();
} else if (/^r(un)?/.test(cmd)) {
trySpawn();
trySpawn(function () {
c.reqContinue(function (res) {
// Wait for break point. (disable raw mode?)
});
});
} else if (/^help/.test(cmd)) {
console.log(helpMessage);

Loading…
Cancel
Save