debugger: Clean up child

pull/22966/head
Ryan Dahl 2010-12-30 00:10:30 -08:00
parent 90e55c3357
commit e33d0de129
1 changed files with 12 additions and 5 deletions

View File

@ -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);