Use blocking read for remote debug to be able to end reading when the end process finishes (PY-14493).

This commit is contained in:
Dmitry Trofimov
2014-12-10 19:26:40 +01:00
parent dac3f6c1f4
commit bb181b6143
@@ -159,7 +159,14 @@ public class RemoteDebugger implements ProcessDebugger {
}
@Override
public ArrayChunk loadArrayItems(String threadId, String frameId, PyDebugValue var, int rowOffset, int colOffset, int rows, int cols, String format) throws PyDebuggerException {
public ArrayChunk loadArrayItems(String threadId,
String frameId,
PyDebugValue var,
int rowOffset,
int colOffset,
int rows,
int cols,
String format) throws PyDebuggerException {
final GetArrayCommand command = new GetArrayCommand(this, threadId, frameId, var, rowOffset, colOffset, rows, cols, format);
command.execute();
return command.getArray();
@@ -486,13 +493,18 @@ public class RemoteDebugger implements ProcessDebugger {
protected void doRun() {
try {
while (true) {
boolean read = readAvailable();
boolean read = readAvailableBlocking();
if (isStopped) {
if (!read) {
break;
}
else {
if (isStopped) {
break;
}
TimeoutUtil.sleep(mySleepingPolicy.getTimeToSleep(read));
TimeoutUtil.sleep(mySleepingPolicy.getTimeToSleep(true));
}
}
}
catch (Exception e) {