Skip to content

Commit 3d100ec

Browse files
Additional handling for Disable on Hit (#699)
This commit moves disable on hit check to JDIThread class + uncheck the option when disabled
1 parent 3f5554e commit 3d100ec

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/BreakpointListenerManager.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ public void breakpointHasRuntimeException(IJavaLineBreakpoint breakpoint, DebugE
151151
public int breakpointHit(IJavaThread thread, IJavaBreakpoint breakpoint) {
152152
IJavaBreakpointListener delegate = getDelegate();
153153
if (delegate != null) {
154-
try {
155-
if (breakpoint.isDisableOnHit()) {
156-
breakpoint.setEnabled(false);
157-
}
158-
} catch (CoreException e) {
159-
JDIDebugPlugin.log(e);
160-
}
161154
return delegate.breakpointHit(thread, breakpoint);
162155
}
163156
return IJavaBreakpointListener.DONT_CARE;
@@ -257,4 +250,4 @@ public IJavaBreakpointListener[] getGlobalListeners() {
257250
init();
258251
return fgGlobalListeners;
259252
}
260-
}
253+
}

org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -1519,6 +1519,9 @@ private boolean handleSuspendForBreakpointInternal(JavaBreakpoint breakpoint) {
15191519
}
15201520
}
15211521
}
1522+
if (suspend) {
1523+
handleDisableOnHit(breakpoint);
1524+
}
15221525
return suspend;
15231526
}
15241527

@@ -3735,4 +3738,15 @@ public void setMethodResult(MethodResult fMethodResult) {
37353738
boolean isBreakpointHandlingOngoing() {
37363739
return fCompletingBreakpointHandling.get() || fHandlingSuspendForBreakpoint.get();
37373740
}
3741+
3742+
private void handleDisableOnHit(JavaBreakpoint breakpoint) {
3743+
try {
3744+
if (breakpoint.isDisableOnHit()) {
3745+
breakpoint.setEnabled(false);
3746+
breakpoint.setDisableOnHit(false);
3747+
}
3748+
} catch (CoreException e) {
3749+
JDIDebugPlugin.log(e);
3750+
}
3751+
}
37383752
}

0 commit comments

Comments
 (0)