Skip to content

Commit cca0352

Browse files
committed
Merge remote-tracking branch 'microsoft/main' into main
2 parents 38a87db + 2461b03 commit cca0352

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1397
-99
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616

17-
- name: Set up JDK 11
17+
- name: Set up JDK 17
1818
uses: actions/setup-java@v1
1919
with:
20-
java-version: '11'
20+
java-version: '17'
2121

2222
- name: Cache local Maven repository
2323
uses: actions/cache@v2
@@ -45,10 +45,10 @@ jobs:
4545
4646
- uses: actions/checkout@v2
4747

48-
- name: Set up JDK 11
48+
- name: Set up JDK 17
4949
uses: actions/setup-java@v1
5050
with:
51-
java-version: '11'
51+
java-version: '17'
5252

5353
- name: Cache local Maven repository
5454
uses: actions/cache@v2
@@ -71,10 +71,10 @@ jobs:
7171
steps:
7272
- uses: actions/checkout@v2
7373

74-
- name: Set up JDK 11
74+
- name: Set up JDK 17
7575
uses: actions/setup-java@v1
7676
with:
77-
java-version: '11'
77+
java-version: '17'
7878

7979
- name: Cache local Maven repository
8080
uses: actions/cache@v2

com.microsoft.java.debug.core/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<attribute name="test" value="true"/>
1414
</attributes>
1515
</classpathentry>
16-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
16+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
1717
<attributes>
1818
<attribute name="maven.pomderived" value="true"/>
1919
</attributes>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>ch.epfl.scala</groupId>
66
<artifactId>com-microsoft-java-debug-core</artifactId>
7+
<packaging>jar</packaging>
78
<name>${base.name} :: Debugger Core</name>
89
<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>
910
<url>https://github.com/Microsoft/java-debug</url>
1011
<version>0.34.0+1-SNAPSHOT</version>
11-
<packaging>jar</packaging>
1212
<properties>
1313
<base.name>Java Debug Server for Visual Studio Code</base.name>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -79,8 +79,8 @@
7979
<artifactId>maven-compiler-plugin</artifactId>
8080
<version>3.7.0</version>
8181
<configuration>
82-
<source>1.8</source>
83-
<target>1.8</target>
82+
<source>11</source>
83+
<target>11</target>
8484
</configuration>
8585
</plugin>
8686
<plugin>
@@ -131,17 +131,17 @@
131131
<dependency>
132132
<groupId>io.reactivex.rxjava2</groupId>
133133
<artifactId>rxjava</artifactId>
134-
<version>2.1.1</version>
134+
<version>2.2.21</version>
135135
</dependency>
136136
<dependency>
137137
<groupId>org.reactivestreams</groupId>
138138
<artifactId>reactive-streams</artifactId>
139-
<version>1.0.0</version>
139+
<version>1.0.4</version>
140140
</dependency>
141141
<dependency>
142142
<groupId>commons-io</groupId>
143143
<artifactId>commons-io</artifactId>
144-
<version>2.10.0</version>
144+
<version>2.11.0</version>
145145
</dependency>
146146
<!-- Dependencies for test -->
147147
<dependency>

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/DebugSession.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,10 @@ public IEventHub getEventHub() {
148148
public VirtualMachine getVM() {
149149
return vm;
150150
}
151+
152+
@Override
153+
public IMethodBreakpoint createFunctionBreakpoint(String className, String functionName, String condition,
154+
int hitCount) {
155+
return new MethodBreakpoint(vm, this.getEventHub(), className, functionName, condition, hitCount);
156+
}
151157
}

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/IDebugSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface IDebugSession {
3636

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

39-
// TODO: createFunctionBreakpoint
39+
IMethodBreakpoint createFunctionBreakpoint(String className, String functionName, String condition, int hitCount);
4040

4141
Process process();
4242

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2022 Microsoft Corporation and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Gayan Perera - initial API and implementation
10+
*******************************************************************************/
11+
package com.microsoft.java.debug.core;
12+
13+
import java.util.concurrent.CompletableFuture;
14+
15+
public interface IMethodBreakpoint extends IDebugResource {
16+
String methodName();
17+
18+
String className();
19+
20+
int getHitCount();
21+
22+
String getCondition();
23+
24+
void setHitCount(int hitCount);
25+
26+
void setCondition(String condition);
27+
28+
CompletableFuture<IMethodBreakpoint> install();
29+
30+
Object getProperty(Object key);
31+
32+
void putProperty(Object key, Object value);
33+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018-2021 Microsoft Corporation and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Microsoft Corporation - initial API and implementation
10+
*******************************************************************************/
11+
12+
package com.microsoft.java.debug.core;
13+
14+
import com.sun.jdi.connect.VMStartException;
15+
16+
/**
17+
* Extends {@link VMStartException} to provide more detail about the failed process
18+
* from before it is destroyed.
19+
*/
20+
public class LaunchException extends VMStartException {
21+
22+
boolean exited;
23+
int exitStatus;
24+
String stdout;
25+
String stderr;
26+
27+
public LaunchException(String message, Process process, boolean exited, int exitStatus, String stdout, String stderr) {
28+
super(message, process);
29+
this.exited = exited;
30+
this.exitStatus = exitStatus;
31+
this.stdout = stdout;
32+
this.stderr = stderr;
33+
}
34+
35+
public boolean isExited() {
36+
return exited;
37+
}
38+
39+
public int getExitStatus() {
40+
return exitStatus;
41+
}
42+
43+
public String getStdout() {
44+
return stdout;
45+
}
46+
47+
public String getStderr() {
48+
return stderr;
49+
}
50+
51+
}

0 commit comments

Comments
 (0)