mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-101456 Throwable at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed.
also remove temporary breakpoint after hit when debug process stops
This commit is contained in:
@@ -249,21 +249,34 @@ public abstract class Breakpoint extends FilteredRequestor implements ClassPrepa
|
||||
}
|
||||
}
|
||||
if (REMOVE_AFTER_HIT) {
|
||||
debugProcess.addDebugProcessListener(new DebugProcessAdapter() {
|
||||
@Override
|
||||
public void resumed(SuspendContext suspendContext) {
|
||||
DebuggerUIUtil.invokeOnEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().removeBreakpoint(Breakpoint.this);
|
||||
}
|
||||
});
|
||||
debugProcess.removeDebugProcessListener(this);
|
||||
}
|
||||
});
|
||||
handleTemporaryBreakpointHit(debugProcess);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTemporaryBreakpointHit(final DebugProcessImpl debugProcess) {
|
||||
debugProcess.addDebugProcessListener(new DebugProcessAdapter() {
|
||||
@Override
|
||||
public void resumed(SuspendContext suspendContext) {
|
||||
removeBreakpoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processDetached(DebugProcess process, boolean closedByUser) {
|
||||
removeBreakpoint();
|
||||
}
|
||||
|
||||
private void removeBreakpoint() {
|
||||
DebuggerUIUtil.invokeOnEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().removeBreakpoint(Breakpoint.this);
|
||||
}
|
||||
});
|
||||
debugProcess.removeDebugProcessListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public final void updateUI() {
|
||||
updateUI(EmptyRunnable.getInstance());
|
||||
}
|
||||
|
||||
@@ -588,22 +588,30 @@ public class XDebugSessionImpl implements XDebugSession {
|
||||
positionReached(suspendContext);
|
||||
|
||||
if (breakpoint instanceof XLineBreakpoint<?> && ((XLineBreakpoint)breakpoint).isTemporary()) {
|
||||
addSessionListener(new XDebugSessionAdapter() {
|
||||
@Override
|
||||
public void sessionResumed() {
|
||||
DebuggerUIUtil.invokeOnEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
XDebuggerManager.getInstance(myProject).getBreakpointManager().removeBreakpoint(breakpoint);
|
||||
}
|
||||
});
|
||||
removeSessionListener(this);
|
||||
}
|
||||
});
|
||||
handleTemporaryBreakpointHit(breakpoint);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void handleTemporaryBreakpointHit(final XBreakpoint<?> breakpoint) {
|
||||
addSessionListener(new XDebugSessionAdapter() {
|
||||
private void removeBreakpoint() {
|
||||
XDebuggerUtil.getInstance().removeBreakpoint(myProject, breakpoint);
|
||||
removeSessionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionResumed() {
|
||||
removeBreakpoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionStopped() {
|
||||
removeBreakpoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void processDependencies(final XBreakpoint<?> breakpoint) {
|
||||
XDependentBreakpointManager dependentBreakpointManager = myDebuggerManager.getBreakpointManager().getDependentBreakpointManager();
|
||||
if (!dependentBreakpointManager.isMasterOrSlave(breakpoint)) return;
|
||||
|
||||
Reference in New Issue
Block a user