Skip to content

Add filtering for step out #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<name>${base.name} :: Debugger Core</name>
<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>
<url>https://github.com/scalacenter/java-debug</url>
<version>0.34.0+2</version>
<version>0.34.0+3-SNAPSHOT</version>
<properties>
<base.name>Java Debug Server for Visual Studio Code</base.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,23 @@ private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession,
threadState.deleteStepRequest(eventRequestManager);
IStepFilterProvider stepFilter = context.getProvider(IStepFilterProvider.class);
try {
if (threadState.pendingStepType == Command.STEPIN) {
if (threadState.pendingStepType == Command.STEPIN || threadState.pendingStepType == Command.STEPOUT) {
int currentStackDepth = thread.frameCount();
Location currentStepLocation = getTopFrame(thread).location();

// If the ending step location is filtered, or same as the original location where the step into operation is originated,
// do another step of the same kind.
if (shouldFilterLocation(threadState.stepLocation, currentStepLocation, stepFilter, context)
|| shouldDoExtraStepInto(threadState.stackDepth, threadState.stepLocation, currentStackDepth, currentStepLocation)) {
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
context.getStepFilters().allowClasses,
context.getStepFilters().skipClasses);
|| shouldDoExtraStep(threadState.stackDepth, threadState.stepLocation, currentStackDepth, currentStepLocation)) {
if (threadState.pendingStepType == Command.STEPIN) {
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
context.getStepFilters().allowClasses,
context.getStepFilters().skipClasses);
} else {
threadState.pendingStepRequest = DebugUtility.createStepIntoRequest(thread,
context.getStepFilters().allowClasses,
context.getStepFilters().skipClasses);
}
threadState.pendingStepRequest.enable();
debugEvent.shouldResume = true;
return;
Expand Down Expand Up @@ -223,7 +229,7 @@ private boolean shouldFilterLocation(Location originalLocation, Location current
* @throws IncompatibleThreadStateException
* if the thread is not suspended in the target VM.
*/
private boolean shouldDoExtraStepInto(int originalStackDepth, Location originalLocation, int currentStackDepth, Location currentLocation)
private boolean shouldDoExtraStep(int originalStackDepth, Location originalLocation, int currentStackDepth, Location currentLocation)
throws IncompatibleThreadStateException {
if (originalStackDepth != currentStackDepth) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Bundle-ClassPath: lib/commons-io-2.10.0.jar,
.,
lib/rxjava-2.1.1.jar,
lib/reactive-streams-1.0.0.jar,
lib/com-microsoft-java-debug-core-0.34.0+2.jar
lib/com-microsoft-java-debug-core-0.34.0+3-SNAPSHOT.jar
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<artifactItem>
<groupId>ch.epfl.scala</groupId>
<artifactId>com-microsoft-java-debug-core</artifactId>
<version>0.34.0+2</version>
<version>0.34.0+3-SNAPSHOT</version>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<repository>
<id>JDT.LS</id>
<layout>p2</layout>
<url>https://download.eclipse.org/jdtls/snapshots/repository/latest/</url>
<url>https://download.eclipse.org/jdtls/snapshots/repository/1.5.0.202110111021/</url>
</repository>
<repository>
<id>JBOLL.TOOLS</id>
Expand Down