restart debugger when debugged process is restarted

pull/152/head
nightwing 2015-09-06 23:18:33 +04:00
rodzic 00fa00256b
commit 12bca69639
3 zmienionych plików z 25 dodań i 3 usunięć

Wyświetl plik

@ -71,7 +71,7 @@
"c9.ide.find": "#35379124ca", "c9.ide.find": "#35379124ca",
"c9.ide.find.infiles": "#c132ad243c", "c9.ide.find.infiles": "#c132ad243c",
"c9.ide.find.replace": "#44772dd796", "c9.ide.find.replace": "#44772dd796",
"c9.ide.run.debug": "#5edf7086bc", "c9.ide.run.debug": "#c2ab990dd4",
"c9.automate": "#47e2c429c9", "c9.automate": "#47e2c429c9",
"c9.ide.ace.emmet": "#6dc4585e02", "c9.ide.ace.emmet": "#6dc4585e02",
"c9.ide.ace.gotoline": "#a8ff07c8f4", "c9.ide.ace.gotoline": "#a8ff07c8f4",

Wyświetl plik

@ -69,7 +69,7 @@ function start() {
tryConnect(debugPort, 100, function(e, debugConnection) { tryConnect(debugPort, 100, function(e, debugConnection) {
console.log("-----------------------------"); console.log("-----------------------------");
debugConnection.on("data", function(data) { debugConnection.on("data", function(data) {
console.log(data + ""); console.log(data + "" + (!outConnection.write ? "<buffer>" : ""));
if (outConnection.write) if (outConnection.write)
outConnection.write(data); outConnection.write(data);
else else
@ -82,11 +82,13 @@ function start() {
}); });
}); });
outConnection = []; outConnection = outConnection || [];
inConnection = []; inConnection = [];
function startServer() { function startServer() {
console.log("start-server")
interceptServer = net.createServer(function(socket) { interceptServer = net.createServer(function(socket) {
console.log(socket)
outConnection.forEach(function(e) {socket.write(e)}); outConnection.forEach(function(e) {socket.write(e)});
outConnection = socket; outConnection = socket;
socket.on("data", function(buffer) { socket.on("data", function(buffer) {
@ -94,9 +96,13 @@ function start() {
}); });
socket.on("error", function(e) { socket.on("error", function(e) {
console.log(e); console.log(e);
})
socket.on("end", function(e) {
outConnection = null
}); });
}).on("error", function(e) { }).on("error", function(e) {
interceptServer = null; interceptServer = null;
console.error(e);
}).listen(port); }).listen(port);
} }
} }
@ -106,6 +112,7 @@ function stop() {
p && p.kill(); p && p.kill();
interceptServer && interceptServer.close(); interceptServer && interceptServer.close();
inConnection.end && inConnection.end(); inConnection.end && inConnection.end();
// outConnection.end && outConnection.end();
} }
process.stdin.resume(); process.stdin.resume();
@ -124,6 +131,11 @@ process.stdin.on("data", function(s) {
buffer += s; buffer += s;
var i = buffer.search(/\s/); var i = buffer.search(/\s/);
if (i == -1) return; 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); var t = parseInt(buffer.slice(0, i), 0);
buffer = ""; buffer = "";
function wait() { function wait() {

Wyświetl plik

@ -14,6 +14,16 @@ var Student = (function () {
return Student; 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(). * A greeter().
*/ */