Skip to content
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 org.eclipse.jdt.debug.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
org.eclipse.jdt.core;bundle-version="[3.34.0,4.0.0)",
org.eclipse.jdt.ui;bundle-version="[3.33.0,4.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.20.0,4.0.0)",
org.eclipse.jdt.debug;bundle-version="[3.21.0,4.0.0)",
org.eclipse.jdt.debug;bundle-version="[3.23.0,4.0.0)",
org.eclipse.jdt.debug.ui;bundle-version="[3.13.0,4.0.0)",
org.eclipse.debug.core;bundle-version="[3.22.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.13.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 IBM Corporation and others.
* Copyright (c) 2016, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,7 @@
package org.eclipse.jdt.debug.tests.breakpoints;

import org.eclipse.debug.core.model.IVariable;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
import org.eclipse.jdt.debug.core.IJavaStackFrame;
Expand Down Expand Up @@ -69,4 +70,69 @@ public void testTriggerPointBreakpoint() throws Exception {
removeAllBreakpoints();
}
}

public void testTriggerPointBreakpointWithResume() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(20, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(21, typeName);
bp1.setTriggerPoint(true);
bp1.setSuspendPolicy(IJavaBreakpoint.RESUME_ON_HIT); // Resume mode
IJavaThread thread = null;
try {
thread = launchToLineBreakpoint(typeName, bp2);

IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame();
int lineNumber = frame.getLineNumber();
assertEquals("Breakpoint should resume and hit next breakpoint", 21, lineNumber);
bp1.delete();
bp2.delete();
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}

public void testTriggerPointBreakpointWithResumeAndCondition() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(20, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(21, typeName);
bp1.setTriggerPoint(true);
bp1.setConditionEnabled(true);
bp1.setCondition("false"); // this wont let breakpoint to resume
Comment thread
SougandhS marked this conversation as resolved.
bp1.setSuspendPolicy(IJavaBreakpoint.RESUME_ON_HIT); // Resume mode
IJavaThread thread = null;
try {
thread = launchToBreakpoint(typeName);
IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame();
int lineNumber = frame.getLineNumber();
assertEquals("Breakpoint should not resume as condition is false", 20, lineNumber);
bp1.delete();
bp2.delete();
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}

public void testTriggerPointBreakpointWithResumeAndConditionAsTrue() throws Exception {
String typeName = "TriggerPoint_01";
IJavaLineBreakpoint bp1 = createLineBreakpoint(20, typeName);
IJavaLineBreakpoint bp2 = createLineBreakpoint(21, typeName);
bp1.setTriggerPoint(true);
bp1.setConditionEnabled(true);
bp1.setCondition("true"); // this will let breakpoint to resume
bp1.setSuspendPolicy(IJavaBreakpoint.RESUME_ON_HIT); // Resume mode
IJavaThread thread = null;
try {
thread = launchToBreakpoint(typeName);
IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame();
int lineNumber = frame.getLineNumber();
assertEquals("Breakpoint should not resume as condition is false", 21, lineNumber);
bp1.delete();
bp2.delete();
} finally {
terminateAndRemove(thread);
removeAllBreakpoints();
}
}
}
4 changes: 2 additions & 2 deletions org.eclipse.jdt.debug.ui/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: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.debug.ui; singleton:=true
Bundle-Version: 3.14.100.qualifier
Bundle-Version: 3.15.0.qualifier
Bundle-Activator: org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down Expand Up @@ -40,7 +40,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.40.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.13.400,4.0.0)",
org.eclipse.jdt.debug;bundle-version="[3.21.0,4.0.0)",
org.eclipse.jdt.debug;bundle-version="[3.23.0,4.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.23.0,4.0.0)",
org.eclipse.jdt.ui;bundle-version="[3.33.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.30.0,4.0.0)",
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.debug.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.debug.ui</artifactId>
<version>3.14.100-SNAPSHOT</version>
<version>3.15.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.debug.core.IJavaBreakpoint;
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import org.eclipse.jdt.debug.core.IJavaWatchpoint;
import org.eclipse.jdt.internal.debug.ui.BreakpointUtils;
Expand Down Expand Up @@ -142,8 +144,7 @@ public final class JavaBreakpointConditionEditor extends AbstractJavaBreakpointE
private IAction fViewRedoAction;
private OperationHistoryActionHandler fViewerUndoAction;
private OperationHistoryActionHandler fViewerRedoAction;


private boolean isResumeOnHit;
/**
* Property id for breakpoint condition expression.
*/
Expand Down Expand Up @@ -361,6 +362,9 @@ public Control createControl(Composite parent) {
public void widgetSelected(SelectionEvent e) {
boolean checked = fConditional.getSelection();
setEnabled(checked, true);
if (isResumeOnHit) {
updateConditionTextOnResume();
}
setDirty(PROP_CONDITION_ENABLED);
}
});
Expand Down Expand Up @@ -455,6 +459,9 @@ public void widgetDisposed(DisposeEvent e) {
dispose();
}
});
if (isResumeOnHit) {
updateConditionTextOnResume();
}
return parent;
}

Expand Down Expand Up @@ -592,6 +599,19 @@ private void disposeViewerUndoRedoActions() {
* @param focus <code>true</code> if focus should be set, <code>false</code> otherwise
*/
private void setEnabled(boolean enabled, boolean focus) {
try {
if (fBreakpoint != null) {
if (fBreakpoint.getSuspendPolicy() == IJavaBreakpoint.RESUME_ON_HIT) {
updateConditionTextOnResume();
} else {
fWhenTrue.setText(PropertyPageMessages.JavaBreakpointConditionEditor_1);
fWhenChange.setText(PropertyPageMessages.JavaBreakpointConditionEditor_2);
}
}
} catch (CoreException e) {
Comment thread
SougandhS marked this conversation as resolved.
DebugUIPlugin.log(e);
}

fViewer.setEditable(enabled);
fViewer.getTextWidget().setEnabled(enabled);
fWhenChange.setEnabled(enabled);
Expand Down Expand Up @@ -843,4 +863,35 @@ private void checkIfUsedInBreakpointsView() {
}
}

/**
* Update label values in Condition editor for trigger points that resume on hit
*
* @since 3.15
*/
public void updateConditionTextOnResume() {
fWhenTrue.setText(PropertyPageMessages.BreakpointResumeConditionalTrue);
fWhenChange.setText(PropertyPageMessages.BreakpointResumeConditionalValue);
}

/**
* Update label values in Condition editor for suspending breakpoints
*
* @since 3.15
*/
public void updateConditionTextOnSuspend() {
fWhenTrue.setText(PropertyPageMessages.JavaBreakpointConditionEditor_1);
fWhenChange.setText(PropertyPageMessages.JavaBreakpointConditionEditor_2);
}

/**
* Set &quot;Resume on hit&quot; flag
*
* @see IJavaBreakpoint#RESUME_ON_HIT
*
* @since 3.15
*/
public void setResumeOnHit(boolean resume) {
isResumeOnHit = resume;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public class DebugUIMessages extends NLS {
public static String JDIModelPresentation_target_suspended;
public static String JDIModelPresentation_thread_filtered;
public static String JDIModelPresentation_uncaught_62;
public static String JDIModelPresentation_resume_on_hit;

// thread label keys are built programmatically

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ JDIModelPresentation_native_method=[native method]
JDIModelPresentation_not_available=not available
JDIModelPresentation_Suspend_VM=[Suspend VM]
JDIModelPresentation_collapsed_frames={0} collapsed frames
JDIModelPresentation_resume_on_hit=[Resume on hit]

###############################################################################
# Thread label keys are built programmatically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,10 @@ protected void appendSuspendPolicy(IJavaBreakpoint breakpoint, StringBuilder buf
buffer.append(' ');
buffer.append(DebugUIMessages.JDIModelPresentation_Suspend_VM);
}
if (breakpoint.getSuspendPolicy() == IJavaBreakpoint.RESUME_ON_HIT) {
buffer.append(' ');
buffer.append(DebugUIMessages.JDIModelPresentation_resume_on_hit);
}
}

protected void appendThreadFilter(IJavaBreakpoint breakpoint, StringBuilder buffer) throws CoreException {
Expand Down
Loading
Loading