From f47057bc429421c85633685e105729beef28c1f5 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 19 Apr 2017 15:51:22 +0300 Subject: [PATCH] experimental option to keep step requests (this allows to continue stepping after hitting a breakpoint in the middle) --- .../com/intellij/debugger/engine/DebugProcessImpl.java | 2 ++ .../com/intellij/debugger/engine/SuspendManagerImpl.java | 9 ++++++--- platform/util/resources/misc/registry.properties | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java index b27ba29d32ad..079a785b167b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java @@ -373,6 +373,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb ? EventRequest.SUSPEND_EVENT_THREAD : EventRequest.SUSPEND_ALL); + stepRequest.addCountFilter(1); + if (hint != null) { //noinspection HardCodedStringLiteral stepRequest.putProperty("hint", hint); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java index f50b75247ad7..d6670be3547d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -18,6 +18,7 @@ package com.intellij.debugger.engine; import com.intellij.debugger.engine.events.DebuggerCommandImpl; import com.intellij.debugger.jdi.ThreadReferenceProxyImpl; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.registry.Registry; import com.sun.jdi.InternalException; import com.sun.jdi.ObjectCollectedException; import com.sun.jdi.event.EventSet; @@ -311,8 +312,10 @@ public class SuspendManagerImpl implements SuspendManager { LOG.debug("vote paused"); myDebugProcess.logThreads(); myDebugProcess.cancelRunToCursorBreakpoint(); - final ThreadReferenceProxyImpl thread = suspendContext.getThread(); - myDebugProcess.deleteStepRequests(thread != null ? thread.getThreadReference() : null); + if (!Registry.is("debugger.keep.step.requests")) { + ThreadReferenceProxyImpl thread = suspendContext.getThread(); + myDebugProcess.deleteStepRequests(thread != null ? thread.getThreadReference() : null); + } notifyPaused(suspendContext); } } diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 85e05f82e07b..8757501d20e5 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -269,6 +269,7 @@ debugger.intern.string.literals.description=Make string literal refer to the sam debugger.capture.points=true debugger.capture.points.annotations=false debugger.resume.yourkit.threads=false +debugger.keep.step.requests=false analyze.exceptions.on.the.fly=false analyze.exceptions.on.the.fly.description=Automatically analyze clipboard on frame activation,\