diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-12-30 11:10:30 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-30 12:35:13 +0300 |
commit | e33d0de129533465276158980e53c0979096b8be (patch) | |
tree | 4cb196e280e384e3829e3f07d961893989efd50f /lib | |
parent | 90e55c3357cc264dfd38626f99a739e8d9927a26 (diff) |
debugger: Clean up child
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_debugger.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js index 382afd18cdb..12f67a75188 100644 --- a/lib/_debugger.js +++ b/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); |