IDEA-278142 Debugger doesn't run the program

GitOrigin-RevId: 199ccc633e5f795763110e101f075d23665ef161
This commit is contained in:
Egor Ushakov
2021-09-14 19:38:11 +03:00
committed by intellij-monorepo-bot
parent 96ca67b701
commit 4fc97bcfa5
2 changed files with 17 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.stream.Stream;
public class DebuggerUtilsImpl extends DebuggerUtilsEx{
@@ -416,4 +417,19 @@ public class DebuggerUtilsImpl extends DebuggerUtilsEx{
}
return null;
}
//TODO: use more general utils when available
public static <T> void forEachSafe(Iterable<T> iterable, Consumer<T> action) {
for (T o : iterable) {
try {
action.accept(o);
}
catch (ProcessCanceledException e) {
throw e;
}
catch (Throwable e) {
LOG.error(e);
}
}
}
}

View File

@@ -602,7 +602,7 @@ public class BreakpointManager {
}
public void reloadBreakpoints() {
ReadAction.run(() -> getBreakpoints().forEach(Breakpoint::reload));
ReadAction.run(() -> DebuggerUtilsImpl.forEachSafe(getBreakpoints(), Breakpoint::reload));
}
public void fireBreakpointChanged(Breakpoint breakpoint) {