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.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",

Wyświetl plik

@ -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 ? "<buffer>" : ""));
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() {

Wyświetl plik

@ -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().
*/