/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return;
}
+ debugProcess.getSession().setSteppingThrough(stackFrame.getStackFrameProxy().threadProxy());
if (!DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
List<PsiStatement> statements = getFinallyStatements(debuggerContext.getSourcePosition());
if (!statements.isEmpty()) {
import com.intellij.unscramble.ThreadState;
import com.intellij.util.Alarm;
import com.intellij.util.TimeoutUtil;
+import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.xdebugger.AbstractDebuggerSession;
import com.intellij.xdebugger.XDebugSession;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
private final DebuggerContextImpl SESSION_EMPTY_CONTEXT;
//Thread, user is currently stepping through
- private final Set<ThreadReferenceProxyImpl> mySteppingThroughThreads = new HashSet<ThreadReferenceProxyImpl>();
+ private final Set<ThreadReferenceProxyImpl> mySteppingThroughThreads = ContainerUtil.newConcurrentSet();
protected final Alarm myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
private boolean myModifiedClassesScanRequired = false;
return mySteppingThroughThreads.contains(threadProxy);
}
+ public boolean setSteppingThrough(ThreadReferenceProxyImpl threadProxy) {
+ return mySteppingThroughThreads.add(threadProxy);
+ }
+
@NotNull
public GlobalSearchScope getSearchScope() {
//noinspection ConstantConditions
}
private boolean shouldSetAsActiveContext(final SuspendContextImpl suspendContext) {
- // always switch context if it is not a breakpoint stop
- if (DebuggerUtilsEx.getEventDescriptors(suspendContext).isEmpty()) {
- return true;
- }
final ThreadReferenceProxyImpl newThread = suspendContext.getThread();
if (newThread == null || suspendContext.getSuspendPolicy() == EventRequest.SUSPEND_ALL || isSteppingThrough(newThread)) {
return true;
@Override
public void resumed(final SuspendContextImpl suspendContext) {
- final SuspendContextImpl currentContext = getProcess().getSuspendManager().getPausedContext();
+ final SuspendContextImpl currentContext = isSteppingThrough(suspendContext.getThread()) ? null : getProcess().getSuspendManager().getPausedContext();
DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
@Override
public void run() {