PY-22979 Sending messages twice from IDE to main debugging process fixed

One of the consequences of the problem was skipping the next breakpoint occasionally after resuming the execution of a Python script because IDE sent `CMD_RUN` message twice to the main debugging script process.
This commit is contained in:
Alexander Koshevoy
2017-12-23 17:44:10 +03:00
parent da94359b10
commit f5237723cd

View File

@@ -39,8 +39,6 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
myPort = port;
myMainDebugger = createDebugger();
myOtherDebuggers.add(myMainDebugger);
}
@NotNull
@@ -55,7 +53,7 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
@Override
public boolean isConnected() {
return getOtherDebuggers().stream().anyMatch(RemoteDebugger::isConnected);
return allDebuggers().stream().anyMatch(RemoteDebugger::isConnected);
}
@Override
@@ -101,7 +99,9 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
private List<RemoteDebugger> allDebuggers() {
List<RemoteDebugger> result;
synchronized (myOtherDebuggersObject) {
result = new ArrayList<>(myOtherDebuggers);
result = new ArrayList<>(myOtherDebuggers.size() + 1);
result.add(myMainDebugger);
result.addAll(myOtherDebuggers);
}
return result;
}