Skip to content

Commit f56bf57

Browse files
committed
Add filtering for step out
1 parent c41a93e commit f56bf57

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

com.microsoft.java.debug.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<name>${base.name} :: Debugger Core</name>
99
<description>The Java Debug Server is an implementation of Visual Studio Code (VSCode) Debug Protocol. It can be used in Visual Studio Code to debug Java programs.</description>
1010
<url>https://github.com/scalacenter/java-debug</url>
11-
<version>0.34.0+2</version>
11+
<version>0.34.0+3-SNAPSHOT</version>
1212
<properties>
1313
<base.name>Java Debug Server for Visual Studio Code</base.name>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/StepRequestHandler.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,23 @@ private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession,
161161
threadState.deleteStepRequest(eventRequestManager);
162162
IStepFilterProvider stepFilter = context.getProvider(IStepFilterProvider.class);
163163
try {
164-
if (threadState.pendingStepType == Command.STEPIN) {
164+
if (threadState.pendingStepType == Command.STEPIN || threadState.pendingStepType == Command.STEPOUT) {
165165
int currentStackDepth = thread.frameCount();
166166
Location currentStepLocation = getTopFrame(thread).location();
167167

168168
// If the ending step location is filtered, or same as the original location where the step into operation is originated,
169169
// do another step of the same kind.
170170
if (shouldFilterLocation(threadState.stepLocation, currentStepLocation, stepFilter, context)
171-
|| shouldDoExtraStepInto(threadState.stackDepth, threadState.stepLocation, currentStackDepth, currentStepLocation)) {
172-
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
173-
context.getStepFilters().allowClasses,
174-
context.getStepFilters().skipClasses);
171+
|| shouldDoExtraStep(threadState.stackDepth, threadState.stepLocation, currentStackDepth, currentStepLocation)) {
172+
if (threadState.pendingStepType == Command.STEPIN) {
173+
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
174+
context.getStepFilters().allowClasses,
175+
context.getStepFilters().skipClasses);
176+
} else {
177+
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
178+
context.getStepFilters().allowClasses,
179+
context.getStepFilters().skipClasses);
180+
}
175181
threadState.pendingStepRequest.enable();
176182
debugEvent.shouldResume = true;
177183
return;
@@ -223,7 +229,7 @@ private boolean shouldFilterLocation(Location originalLocation, Location current
223229
* @throws IncompatibleThreadStateException
224230
* if the thread is not suspended in the target VM.
225231
*/
226-
private boolean shouldDoExtraStepInto(int originalStackDepth, Location originalLocation, int currentStackDepth, Location currentLocation)
232+
private boolean shouldDoExtraStep(int originalStackDepth, Location originalLocation, int currentStackDepth, Location currentLocation)
227233
throws IncompatibleThreadStateException {
228234
if (originalStackDepth != currentStackDepth) {
229235
return false;

com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Bundle-ClassPath: lib/commons-io-2.10.0.jar,
2525
.,
2626
lib/rxjava-2.1.1.jar,
2727
lib/reactive-streams-1.0.0.jar,
28-
lib/com-microsoft-java-debug-core-0.34.0+2.jar
28+
lib/com-microsoft-java-debug-core-0.34.0+3-SNAPSHOT.jar

com.microsoft.java.debug.plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<artifactItem>
4646
<groupId>ch.epfl.scala</groupId>
4747
<artifactId>com-microsoft-java-debug-core</artifactId>
48-
<version>0.34.0+2</version>
48+
<version>0.34.0+3-SNAPSHOT</version>
4949
</artifactItem>
5050
</artifactItems>
5151
</configuration>

0 commit comments

Comments
 (0)