Skip to content

Commit

Permalink
Support set exception breakpoint asynchronously & bump veriosn to 0.4…
Browse files Browse the repository at this point in the history
…5.0 (#482)

* Support set exception breakpoint asynchronously & bump veriosn to 0.45.0
  • Loading branch information
testforstephen authored Apr 24, 2023
1 parent 9df6f5d commit 87fae71
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 11 deletions.
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 @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.44.0</version>
<version>0.45.0</version>
</parent>
<artifactId>com.microsoft.java.debug.core</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,18 @@ public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught
}
}

@Override
public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught, String[] exceptionTypes,
String[] classFilters, String[] classExclusionFilters, boolean async) {
if (async) {
AsyncJdwpUtils.runAsync(() -> {
setExceptionBreakpoints(notifyCaught, notifyUncaught, exceptionTypes, classFilters, classExclusionFilters);
});
} else {
setExceptionBreakpoints(notifyCaught, notifyUncaught, exceptionTypes, classFilters, classExclusionFilters);
}
}

@Override
public Process process() {
return vm.process();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public interface IDebugSession {

void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught, String[] exceptionTypes, String[] classFilters, String[] classExclusionFilters);

void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught, String[] exceptionTypes, String[] classFilters, String[] classExclusionFilters,
boolean async);

IMethodBreakpoint createFunctionBreakpoint(String className, String functionName, String condition, int hitCount);

Process process();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class SetExceptionBreakpointsRequestHandler implements IDebugRequestHandl
private boolean isInitialized = false;
private boolean notifyCaught = false;
private boolean notifyUncaught = false;
private boolean asyncJDWP = false;

@Override
public List<Command> getTargetCommands() {
Expand All @@ -53,6 +54,7 @@ public synchronized CompletableFuture<Response> handle(Command command, Argument
if (!isInitialized) {
isInitialized = true;
debugSession = context.getDebugSession();
asyncJDWP = context.asyncJDWP();
DebugSettings.addDebugSettingChangeListener(this);
debugSession.getEventHub().events().subscribe(debugEvent -> {
if (debugEvent.event instanceof VMDeathEvent
Expand Down Expand Up @@ -81,7 +83,7 @@ private void setExceptionBreakpoints(IDebugSession debugSession, boolean notifyC
String[] exceptionTypes = (exceptionFilters == null ? null : exceptionFilters.exceptionTypes);
String[] classFilters = (exceptionFilters == null ? null : exceptionFilters.allowClasses);
String[] classExclusionFilters = (exceptionFilters == null ? null : exceptionFilters.skipClasses);
debugSession.setExceptionBreakpoints(notifyCaught, notifyUncaught, exceptionTypes, classFilters, classExclusionFilters);
debugSession.setExceptionBreakpoints(notifyCaught, notifyUncaught, exceptionTypes, classFilters, classExclusionFilters, this.asyncJDWP);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.plugin/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="lib" path="lib/rxjava-2.2.21.jar"/>
<classpathentry exported="true" kind="lib" path="lib/reactive-streams-1.0.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.44.0.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry exported="true" kind="lib" path="lib/com.microsoft.java.debug.core-0.45.0.jar" sourcepath="/com.microsoft.java.debug.core"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Java Debug Server Plugin
Bundle-SymbolicName: com.microsoft.java.debug.plugin;singleton:=true
Bundle-Version: 0.44.0
Bundle-Version: 0.45.0
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-ActivationPolicy: lazy
Bundle-Activator: com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin
Expand All @@ -25,4 +25,4 @@ Bundle-ClassPath: lib/commons-io-2.11.0.jar,
.,
lib/rxjava-2.2.21.jar,
lib/reactive-streams-1.0.4.jar,
lib/com.microsoft.java.debug.core-0.44.0.jar
lib/com.microsoft.java.debug.core-0.45.0.jar
4 changes: 2 additions & 2 deletions com.microsoft.java.debug.plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.44.0</version>
<version>0.45.0</version>
</parent>
<artifactId>com.microsoft.java.debug.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down Expand Up @@ -56,7 +56,7 @@
<artifactItem>
<groupId>com.microsoft.java</groupId>
<artifactId>com.microsoft.java.debug.core</artifactId>
<version>0.44.0</version>
<version>0.45.0</version>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<bundle id="com.microsoft.java.debug.plugin" version="0.44.0">
<bundle id="com.microsoft.java.debug.plugin" version="0.45.0">
<category name="javadebug" />
</bundle>
<category-def name="javadebug" label="Java Debug Server"/>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.44.0</version>
<version>0.45.0</version>
</parent>
<artifactId>com.microsoft.java.debug.repository</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
2 changes: 1 addition & 1 deletion com.microsoft.java.debug.target/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.microsoft.java</groupId>
<artifactId>java-debug-parent</artifactId>
<version>0.44.0</version>
<version>0.45.0</version>
</parent>
<artifactId>com.microsoft.java.debug.tp</artifactId>
<name>${base.name} :: Target Platform</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<name>${base.name} :: Parent</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/Microsoft/java-debug</url>
<version>0.44.0</version>
<version>0.45.0</version>
<packaging>pom</packaging>
<properties>
<base.name>Java Debug Server for Visual Studio Code</base.name>
Expand Down

0 comments on commit 87fae71

Please sign in to comment.