Skip to content

Commit 02ea1e4

Browse files
committed
Revert to previous state
1 parent b48a562 commit 02ea1e4

16 files changed

Lines changed: 56 additions & 118 deletions

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

Lines changed: 14 additions & 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-21">
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>
@@ -31,6 +31,19 @@
3131
<attribute name="m2e-apt" value="true"/>
3232
</attributes>
3333
</classpathentry>
34+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
35+
<attributes>
36+
<attribute name="maven.pomderived" value="true"/>
37+
<attribute name="optional" value="true"/>
38+
</attributes>
39+
</classpathentry>
40+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
41+
<attributes>
42+
<attribute name="maven.pomderived" value="true"/>
43+
<attribute name="test" value="true"/>
44+
<attribute name="optional" value="true"/>
45+
</attributes>
46+
</classpathentry>
3447
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
3548
<attributes>
3649
<attribute name="optional" value="true"/>

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

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,24 @@ public class Breakpoint implements IBreakpoint {
4242
private String condition = null;
4343
private String logMessage = null;
4444
private HashMap<Object, Object> propertyMap = new HashMap<>();
45-
private final boolean suspendAllThreads;
4645

4746
private boolean async = false;
4847

49-
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, boolean suspendAllThreads) {
50-
this(vm, eventHub, className, lineNumber, 0, null, suspendAllThreads);
48+
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber) {
49+
this(vm, eventHub, className, lineNumber, 0, null);
5150
}
5251

53-
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount, boolean suspendAllThreads) {
54-
this(vm, eventHub, className, lineNumber, hitCount, null, suspendAllThreads);
52+
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount) {
53+
this(vm, eventHub, className, lineNumber, hitCount, null);
5554
}
5655

57-
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount,
58-
String condition, boolean suspendAllThreads) {
59-
this(vm, eventHub, className, lineNumber, hitCount, condition, null, suspendAllThreads);
56+
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount, String condition) {
57+
this(vm, eventHub, className, lineNumber, hitCount, condition, null);
6058
}
6159

62-
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount,
63-
String condition, String logMessage, boolean suspendAllThreads) {
60+
Breakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount, String condition, String logMessage) {
6461
this.vm = vm;
6562
this.eventHub = eventHub;
66-
this.suspendAllThreads = suspendAllThreads;
6763
String contextClass = className;
6864
String methodName = null;
6965
String methodSignature = null;
@@ -83,15 +79,13 @@ public class Breakpoint implements IBreakpoint {
8379
this.logMessage = logMessage;
8480
}
8581

86-
Breakpoint(VirtualMachine vm, IEventHub eventHub, JavaBreakpointLocation sourceLocation, int hitCount,
87-
String condition, String logMessage, boolean suspendAllThreads) {
82+
Breakpoint(VirtualMachine vm, IEventHub eventHub, JavaBreakpointLocation sourceLocation, int hitCount, String condition, String logMessage) {
8883
this.vm = vm;
8984
this.eventHub = eventHub;
9085
this.sourceLocation = sourceLocation;
9186
this.hitCount = hitCount;
9287
this.condition = condition;
9388
this.logMessage = logMessage;
94-
this.suspendAllThreads = suspendAllThreads;
9589
}
9690

9791
// IDebugResource
@@ -209,19 +203,6 @@ public void setAsync(boolean async) {
209203
this.async = async;
210204
}
211205

212-
@Override
213-
public void setSuspendPolicy(String policy) {
214-
}
215-
216-
@Override
217-
public String getSuspendPolicy() {
218-
return suspendAllThreads ? "SUSPEND_ALL" : "SUSPEND_EVENT_THREAD";
219-
}
220-
221-
protected boolean suspendAllThreads() {
222-
return suspendAllThreads;
223-
}
224-
225206
@Override
226207
public CompletableFuture<IBreakpoint> install() {
227208
// It's possible that different class loaders create new class with the same name.
@@ -431,11 +412,7 @@ private CompletableFuture<List<BreakpointRequest>> createBreakpointRequests(List
431412

432413
newLocations.forEach(location -> {
433414
BreakpointRequest request = vm.eventRequestManager().createBreakpointRequest(location);
434-
if ("SUSPEND_ALL".equals(getSuspendPolicy())) {
435-
request.setSuspendPolicy(BreakpointRequest.SUSPEND_ALL);
436-
} else {
437-
request.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
438-
}
415+
request.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
439416
if (hitCount > 0) {
440417
request.addCountFilter(hitCount);
441418
}

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ public class DebugSession implements IDebugSession {
3636
private EventHub eventHub = new EventHub();
3737
private List<EventRequest> eventRequests = new ArrayList<>();
3838
private List<Disposable> subscriptions = new ArrayList<>();
39-
private final boolean suspendAllThreads;
4039

4140
public DebugSession(VirtualMachine virtualMachine) {
4241
vm = virtualMachine;
43-
// Capture suspend policy at session start - this persists for the session lifetime
44-
this.suspendAllThreads = DebugSettings.getCurrent().suspendAllThreads;
4542
}
4643

4744
@Override
@@ -131,17 +128,17 @@ public void terminate() {
131128

132129
@Override
133130
public IBreakpoint createBreakpoint(JavaBreakpointLocation sourceLocation, int hitCount, String condition, String logMessage) {
134-
return new EvaluatableBreakpoint(vm, this.getEventHub(), sourceLocation, hitCount, condition, logMessage, suspendAllThreads);
131+
return new EvaluatableBreakpoint(vm, this.getEventHub(), sourceLocation, hitCount, condition, logMessage);
135132
}
136133

137134
@Override
138135
public IBreakpoint createBreakpoint(String className, int lineNumber, int hitCount, String condition, String logMessage) {
139-
return new EvaluatableBreakpoint(vm, this.getEventHub(), className, lineNumber, hitCount, condition, logMessage, suspendAllThreads);
136+
return new EvaluatableBreakpoint(vm, this.getEventHub(), className, lineNumber, hitCount, condition, logMessage);
140137
}
141138

142139
@Override
143140
public IWatchpoint createWatchPoint(String className, String fieldName, String accessType, String condition, int hitCount) {
144-
return new Watchpoint(vm, this.getEventHub(), className, fieldName, accessType, condition, hitCount, suspendAllThreads);
141+
return new Watchpoint(vm, this.getEventHub(), className, fieldName, accessType, condition, hitCount);
145142
}
146143

147144
@Override
@@ -188,7 +185,7 @@ public void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught
188185

189186
if (exceptionTypes == null || exceptionTypes.length == 0) {
190187
ExceptionRequest request = manager.createExceptionRequest(null, notifyCaught, notifyUncaught);
191-
request.setSuspendPolicy(suspendAllThreads ? EventRequest.SUSPEND_ALL : EventRequest.SUSPEND_EVENT_THREAD);
188+
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
192189
if (classFilters != null) {
193190
for (String classFilter : classFilters) {
194191
request.addClassFilter(classFilter);
@@ -263,22 +260,17 @@ public VirtualMachine getVM() {
263260
return vm;
264261
}
265262

266-
@Override
267-
public boolean shouldSuspendAllThreads() {
268-
return suspendAllThreads;
269-
}
270-
271263
@Override
272264
public IMethodBreakpoint createFunctionBreakpoint(String className, String functionName, String condition,
273265
int hitCount) {
274-
return new MethodBreakpoint(vm, this.getEventHub(), className, functionName, condition, hitCount, suspendAllThreads);
266+
return new MethodBreakpoint(vm, this.getEventHub(), className, functionName, condition, hitCount);
275267
}
276268

277269
private void createExceptionBreakpoint(ReferenceType refType, boolean notifyCaught, boolean notifyUncaught,
278270
String[] classFilters, String[] classExclusionFilters) {
279271
EventRequestManager manager = vm.eventRequestManager();
280272
ExceptionRequest request = manager.createExceptionRequest(refType, notifyCaught, notifyUncaught);
281-
request.setSuspendPolicy(suspendAllThreads ? EventRequest.SUSPEND_ALL : EventRequest.SUSPEND_EVENT_THREAD);
273+
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
282274
if (classFilters != null) {
283275
for (String classFilter : classFilters) {
284276
request.addClassFilter(classFilter);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public final class DebugSettings {
4545
public int jdwpRequestTimeout = 3000;
4646
public AsyncMode asyncJDWP = AsyncMode.OFF;
4747
public Switch debugSupportOnDecompiledSource = Switch.OFF;
48-
public boolean suspendAllThreads = false;
4948

5049
public static DebugSettings getCurrent() {
5150
return current;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ private static StepRequest createStepRequest(ThreadReference thread, int stepSiz
394394
request.addClassExclusionFilter(exclusionFilter);
395395
}
396396
}
397-
// Note: suspend policy will be set by the caller (StepRequestHandler) based on session settings
398397
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
399398
request.addCountFilter(1);
400399

@@ -416,7 +415,7 @@ public static CompletableFuture<Long> stopOnEntry(IDebugSession debugSession, St
416415
EventRequestManager manager = debugSession.getVM().eventRequestManager();
417416
MethodEntryRequest request = manager.createMethodEntryRequest();
418417
request.addClassFilter(mainClass);
419-
request.setSuspendPolicy(debugSession.shouldSuspendAllThreads() ? EventRequest.SUSPEND_ALL : EventRequest.SUSPEND_EVENT_THREAD);
418+
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
420419

421420
debugSession.getEventHub().events().filter(debugEvent -> {
422421
return debugEvent.event instanceof MethodEntryEvent && request.equals(debugEvent.event.request());

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ public class EvaluatableBreakpoint extends Breakpoint implements IEvaluatableBre
2929
private Object compiledLogpointExpression = null;
3030
private Map<Long, Object> compiledExpressions = new ConcurrentHashMap<>();
3131

32-
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, boolean suspendAllThreads) {
33-
this(vm, eventHub, className, lineNumber, 0, null, suspendAllThreads);
32+
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber) {
33+
this(vm, eventHub, className, lineNumber, 0, null);
3434
}
3535

36-
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount, boolean suspendAllThreads) {
37-
this(vm, eventHub, className, lineNumber, hitCount, null, suspendAllThreads);
36+
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount) {
37+
this(vm, eventHub, className, lineNumber, hitCount, null);
3838
}
3939

4040
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount,
41-
String condition, boolean suspendAllThreads) {
42-
this(vm, eventHub, className, lineNumber, hitCount, condition, null, suspendAllThreads);
41+
String condition) {
42+
this(vm, eventHub, className, lineNumber, hitCount, condition, null);
4343
}
4444

4545
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, int lineNumber, int hitCount,
46-
String condition, String logMessage, boolean suspendAllThreads) {
47-
super(vm, eventHub, className, lineNumber, hitCount, condition, logMessage, suspendAllThreads);
46+
String condition, String logMessage) {
47+
super(vm, eventHub, className, lineNumber, hitCount, condition, logMessage);
4848
this.eventHub = eventHub;
4949
}
5050

5151
EvaluatableBreakpoint(VirtualMachine vm, IEventHub eventHub, JavaBreakpointLocation sourceLocation, int hitCount,
52-
String condition, String logMessage, boolean suspendAllThreads) {
53-
super(vm, eventHub, sourceLocation, hitCount, condition, logMessage, suspendAllThreads);
52+
String condition, String logMessage) {
53+
super(vm, eventHub, sourceLocation, hitCount, condition, logMessage);
5454
this.eventHub = eventHub;
5555
}
5656

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,4 @@ default void setAsync(boolean async) {
5555
default boolean async() {
5656
return false;
5757
}
58-
59-
default void setSuspendPolicy(String policy) {
60-
}
61-
62-
default String getSuspendPolicy() {
63-
return null;
64-
}
6558
}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,4 @@ void setExceptionBreakpoints(boolean notifyCaught, boolean notifyUncaught, Strin
5252
IEventHub getEventHub();
5353

5454
VirtualMachine getVM();
55-
56-
/**
57-
* Returns whether breakpoints should suspend all threads or just the event thread.
58-
* This value is captured at session start and persists for the session lifetime.
59-
*/
60-
boolean shouldSuspendAllThreads();
6155
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class MethodBreakpoint implements IMethodBreakpoint, IEvaluatableBreakpoi
4444
private String condition;
4545
private int hitCount;
4646
private boolean async = false;
47-
private final boolean suspendAllThreads;
4847

4948
private HashMap<Object, Object> propertyMap = new HashMap<>();
5049
private Object compiledConditionalExpression = null;
@@ -54,7 +53,7 @@ public class MethodBreakpoint implements IMethodBreakpoint, IEvaluatableBreakpoi
5453
private List<Disposable> subscriptions = new ArrayList<>();
5554

5655
public MethodBreakpoint(VirtualMachine vm, IEventHub eventHub, String className, String functionName,
57-
String condition, int hitCount, boolean suspendAllThreads) {
56+
String condition, int hitCount) {
5857
Objects.requireNonNull(vm);
5958
Objects.requireNonNull(eventHub);
6059
Objects.requireNonNull(className);
@@ -65,7 +64,6 @@ public MethodBreakpoint(VirtualMachine vm, IEventHub eventHub, String className,
6564
this.functionName = functionName;
6665
this.condition = condition;
6766
this.hitCount = hitCount;
68-
this.suspendAllThreads = suspendAllThreads;
6967
}
7068

7169
@Override
@@ -264,7 +262,7 @@ private Optional<MethodEntryRequest> createMethodEntryRequest0(ReferenceType typ
264262
MethodEntryRequest request = vm.eventRequestManager().createMethodEntryRequest();
265263

266264
request.addClassFilter(type);
267-
request.setSuspendPolicy(suspendAllThreads ? EventRequest.SUSPEND_ALL : EventRequest.SUSPEND_EVENT_THREAD);
265+
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
268266
if (hitCount > 0) {
269267
request.addCountFilter(hitCount);
270268
}

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,20 @@ public class Watchpoint implements IWatchpoint, IEvaluatableBreakpoint {
4646
private HashMap<Object, Object> propertyMap = new HashMap<>();
4747
private Object compiledConditionalExpression = null;
4848
private Map<Long, Object> compiledExpressions = new ConcurrentHashMap<>();
49-
private final boolean suspendAllThreads;
5049

5150
// IDebugResource
5251
private List<EventRequest> requests = new ArrayList<>();
5352
private List<Disposable> subscriptions = new ArrayList<>();
5453

55-
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName, boolean suspendAllThreads) {
56-
this(vm, eventHub, className, fieldName, "write", suspendAllThreads);
54+
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName) {
55+
this(vm, eventHub, className, fieldName, "write");
5756
}
5857

59-
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName, String accessType, boolean suspendAllThreads) {
60-
this(vm, eventHub, className, fieldName, accessType, null, 0, suspendAllThreads);
58+
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName, String accessType) {
59+
this(vm, eventHub, className, fieldName, accessType, null, 0);
6160
}
6261

63-
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName, String accessType,
64-
String condition, int hitCount, boolean suspendAllThreads) {
62+
Watchpoint(VirtualMachine vm, IEventHub eventHub, String className, String fieldName, String accessType, String condition, int hitCount) {
6563
Objects.requireNonNull(vm);
6664
Objects.requireNonNull(eventHub);
6765
Objects.requireNonNull(className);
@@ -73,7 +71,6 @@ public class Watchpoint implements IWatchpoint, IEvaluatableBreakpoint {
7371
this.accessType = accessType;
7472
this.condition = condition;
7573
this.hitCount = hitCount;
76-
this.suspendAllThreads = suspendAllThreads;
7774
}
7875

7976
@Override
@@ -215,7 +212,7 @@ private List<WatchpointRequest> createWatchpointRequests(ReferenceType type) {
215212
}
216213

217214
watchpointRequests.forEach(request -> {
218-
request.setSuspendPolicy(suspendAllThreads ? EventRequest.SUSPEND_ALL : EventRequest.SUSPEND_EVENT_THREAD);
215+
request.setSuspendPolicy(WatchpointRequest.SUSPEND_EVENT_THREAD);
219216
if (hitCount > 0) {
220217
request.addCountFilter(hitCount);
221218
}

0 commit comments

Comments
 (0)