diff --git a/package.json b/package.json index 453716db..5091ff44 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "c9.ide.find": "#35379124ca", "c9.ide.find.infiles": "#c132ad243c", "c9.ide.find.replace": "#44772dd796", - "c9.ide.run.debug": "#5edf7086bc", + "c9.ide.run.debug": "#c2ab990dd4", "c9.automate": "#47e2c429c9", "c9.ide.ace.emmet": "#6dc4585e02", "c9.ide.ace.gotoline": "#a8ff07c8f4", diff --git a/plugins/c9.fs/mock/debug.js b/plugins/c9.fs/mock/debug.js index 74ee2ecc..081b7635 100644 --- a/plugins/c9.fs/mock/debug.js +++ b/plugins/c9.fs/mock/debug.js @@ -69,7 +69,7 @@ function start() { tryConnect(debugPort, 100, function(e, debugConnection) { console.log("-----------------------------"); debugConnection.on("data", function(data) { - console.log(data + ""); + console.log(data + "" + (!outConnection.write ? "" : "")); if (outConnection.write) outConnection.write(data); else @@ -82,11 +82,13 @@ function start() { }); }); - outConnection = []; + outConnection = outConnection || []; inConnection = []; function startServer() { + console.log("start-server") interceptServer = net.createServer(function(socket) { + console.log(socket) outConnection.forEach(function(e) {socket.write(e)}); outConnection = socket; socket.on("data", function(buffer) { @@ -94,9 +96,13 @@ function start() { }); socket.on("error", function(e) { console.log(e); + }) + socket.on("end", function(e) { + outConnection = null }); }).on("error", function(e) { interceptServer = null; + console.error(e); }).listen(port); } } @@ -106,6 +112,7 @@ function stop() { p && p.kill(); interceptServer && interceptServer.close(); inConnection.end && inConnection.end(); + // outConnection.end && outConnection.end(); } process.stdin.resume(); @@ -124,6 +131,11 @@ process.stdin.on("data", function(s) { buffer += s; var i = buffer.search(/\s/); if (i == -1) return; + if (/^d-out/.test(buffer)) { + console.log("end netproxy connection"); + outConnection.end && outConnection.end(); + return; + } var t = parseInt(buffer.slice(0, i), 0); buffer = ""; function wait() { diff --git a/plugins/c9.fs/mock/test.js b/plugins/c9.fs/mock/test.js index b07b88ff..558c2a2e 100644 --- a/plugins/c9.fs/mock/test.js +++ b/plugins/c9.fs/mock/test.js @@ -14,6 +14,16 @@ var Student = (function () { return Student; })(); +var options = {x: 1} +function d(a) { + var options = {x: 2} + function e(a) { + var options = {x: 2} + console.log(1) + } + e() +} +d() /** * A greeter(). */