IDEA-43728 - better fix for duplicated SUSPEND_ALL contexts
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 8 Jul 2015 12:36:06 +0000 (15:36 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Wed, 8 Jul 2015 12:37:08 +0000 (15:37 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java

index 4e23d5a93f97538ec796c1f92d6bf157e7dbf01a..4910d870799f2f5747e688f74c15648306613cb0 100644 (file)
@@ -191,8 +191,15 @@ public class DebugProcessEvents extends DebugProcessImpl {
               protected void action() throws Exception {
                 if (eventSet.suspendPolicy() == EventRequest.SUSPEND_ALL && !DebuggerSession.enableBreakpointsDuringEvaluation()) {
                   // check if there is already one request with policy SUSPEND_ALL
-                  for (SuspendContextImpl context : getSuspendManager().getEventContexts()) {
+                  contexts: for (SuspendContextImpl context : getSuspendManager().getEventContexts()) {
                     if (context.getSuspendPolicy() == EventRequest.SUSPEND_ALL) {
+                      for (Event event : eventSet) {
+                        if (event instanceof StepEvent) {
+                          // if step event is present - switch context
+                          ((SuspendManagerImpl)getSuspendManager()).popContext(context);
+                          continue contexts;
+                        }
+                      }
                       eventSet.resume();
                       return;
                     }