mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-43728 Provide a way to step in a chosen thread while others remain suspended
This commit is contained in:
@@ -414,8 +414,9 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
// suspend policy to match the suspend policy of the context:
|
||||
// if all threads were suspended, then during stepping all the threads must be suspended
|
||||
// if only event thread were suspended, then only this particular thread must be suspended during stepping
|
||||
stepRequest.setSuspendPolicy(Registry.is("debugger.step.resumes.one.thread") ? EventRequest.SUSPEND_EVENT_THREAD
|
||||
: suspendContext.getSuspendPolicy());
|
||||
stepRequest.setSuspendPolicy(suspendContext.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD
|
||||
? EventRequest.SUSPEND_EVENT_THREAD
|
||||
: EventRequest.SUSPEND_ALL);
|
||||
|
||||
if (hint != null) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
@@ -1648,7 +1649,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
@Override
|
||||
protected void resumeAction() {
|
||||
SuspendContextImpl context = getSuspendContext();
|
||||
if (context != null && context.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD) {
|
||||
if (context != null &&
|
||||
(context.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD || Registry.is("debugger.step.resumes.one.thread"))) {
|
||||
myThreadBlockedMonitor.startWatching(myContextThread);
|
||||
}
|
||||
if (context != null
|
||||
@@ -1740,7 +1742,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
|
||||
|
||||
final Set<SuspendContextImpl> suspendingContexts = SuspendManagerUtil.getSuspendingContexts(getSuspendManager(), myThread);
|
||||
for (SuspendContextImpl suspendContext : suspendingContexts) {
|
||||
if (suspendContext.getThread() == myThread) {
|
||||
if (suspendContext.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD && suspendContext.getThread() == myThread) {
|
||||
getSession().getXDebugSession().sessionResumed();
|
||||
getManagerThread().invoke(createResumeCommand(suspendContext));
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
|
||||
import com.intellij.xdebugger.ui.XDebugTabLayouter;
|
||||
import com.sun.jdi.event.Event;
|
||||
import com.sun.jdi.request.EventRequest;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.java.debugger.JavaDebuggerEditorsProvider;
|
||||
@@ -187,9 +186,7 @@ public class JavaDebugProcess extends XDebugProcess {
|
||||
|
||||
private void unsetPausedIfNeeded(DebuggerContextImpl context) {
|
||||
SuspendContextImpl suspendContext = context.getSuspendContext();
|
||||
if (suspendContext != null
|
||||
&& suspendContext.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD
|
||||
&& context.getThreadProxy() != suspendContext.getThread()) {
|
||||
if (suspendContext != null && !suspendContext.suspends(context.getThreadProxy())) {
|
||||
((XDebugSessionImpl)getSession()).unsetPaused();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user