Skip to content

Add support for breakpoint-to-breakpoint dependencies - #967

Open
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:WaitingForBreakpoint
Open

Add support for breakpoint-to-breakpoint dependencies#967
SougandhS wants to merge 1 commit into
eclipse-jdt:masterfrom
SougandhS:WaitingForBreakpoint

Conversation

@SougandhS

@SougandhS SougandhS commented Jun 15, 2026

Copy link
Copy Markdown
Member

This PR introduces breakpoint-to-breakpoint dependency support. A breakpoint can now be configured to suspend execution only after another breakpoint has been hit, enabling more precise control over complex debugging workflows. Dependency breakpoints can also be configured to automatically continue execution on their first hit, allowing them to act as trigger points that activate dependent breakpoints without interrupting the debugging session.

This capability reduces the need for complex conditional breakpoint expressions, minimizes manual breakpoint management, and introduces better flow-based debugging control. For example, when a frequently invoked method is reached many times during a debugging session, a dependent breakpoint can be configured to suspend execution only when that method is called as part of a specific execution flow that was activated by another breakpoint
eg. (Suspend A only when called from C)

Similar breakpoint dependency and chaining capabilities are available in other modern Java IDEs.

Workflow -
Click on the wait until checkbox

image

Now Select the dependent breakpoint. (Which will make user's current bp only hit after the selected bp is hit)
There's also option to continue execution on first hit which is similar to Resume Triggers , and an option to remove existing dependent bp if added

image

Once selected, the Breakpoint which is waiting for another bp to hit will have [waiting] label and the dependent bp will have a label of [dependency]
Also, "wait until" selection will show the name of the dependent bp as link (users can click this link to change the bp) or disable the dependancy condition by unchecking "wait until"

image
Work.mp4

What it does

How to test

Author checklist

@eclipse-jdt-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.debug/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From d4c4e5e54081024f1caaa5689f2742c1587f3ecb Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Mon, 15 Jun 2026 09:57:20 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
index c7bc713a2..5ef560aea 100644
--- a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.debug; singleton:=true
-Bundle-Version: 3.26.0.qualifier
+Bundle-Version: 3.26.100.qualifier
 Bundle-ClassPath: jdimodel.jar
 Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
 Bundle-Vendor: %providerName
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “breakpoint-to-breakpoint” dependency support to Eclipse JDT Debug, allowing a breakpoint to suspend only after another breakpoint has been hit, with optional “continue on first hit” behavior for dependency breakpoints.

Changes:

  • Extends the breakpoint core model/API to store dependency relationships and “hit” state used to gate suspension.
  • Updates UI breakpoint property editor + model presentation labels to configure and display [waiting] / [dependency].
  • Adds a new automated test suite and test programs to validate dependency behavior (including chaining and condition/hitcount interactions).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java Updates breakpoint suspend handling to record “hit” state and implement resume-on-first-hit for dependency breakpoints.
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaBreakpoint.java Adds dependency attributes/state and gating logic for waiting breakpoints.
org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java Adds new public API for dependency configuration and “hit” tracking.
org.eclipse.jdt.debug/META-INF/MANIFEST.MF Bumps bundle version to 3.27.0.qualifier.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/PropertyPageMessages.properties Adds new UI strings for dependency selection/config.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/propertypages/PropertyPageMessages.java Exposes the new property page message keys.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIModelPresentation.java Appends [waiting] / [dependency] labels to breakpoint presentation text.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DebugUIMessages.properties Adds message keys for new breakpoint labels.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DebugUIMessages.java Declares new NLS message fields for the labels.
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java Adds “Wait Until” UI, dependency selection dialog, and dependency management actions.
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/breakpoints/DependencyBreakpointsTests.java New test suite covering dependency scenarios and chaining.
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java Registers the new dependency tests.
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java Adds new test program names to the test harness.
org.eclipse.jdt.debug.tests/testprograms/ExternalClassTst.java New test program used by dependency tests.
org.eclipse.jdt.debug.tests/testprograms/DependencyTest.java New test program used by dependency tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SougandhS

Copy link
Copy Markdown
Member Author

Thanks for triggering Co-Pilot, will go through the comments soon 👍

@SougandhS
SougandhS force-pushed the WaitingForBreakpoint branch from c0cd7e0 to cb39e1d Compare June 24, 2026 14:53
@SougandhS

Copy link
Copy Markdown
Member Author

Hi @iloveeclipse,
Could you please trigger co-pilot review for a second round ?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 13 comments.

Comment thread org.eclipse.jdt.debug.tests/testprograms/ExternalClassTst.java Outdated
Comment thread org.eclipse.jdt.debug.tests/testprograms/DependencyTest.java Outdated
@SougandhS
SougandhS force-pushed the WaitingForBreakpoint branch from ae326ff to 1e13741 Compare August 17, 2026 11:42
@SougandhS
SougandhS force-pushed the WaitingForBreakpoint branch from 1c96268 to 83b4ab2 Compare August 30, 2026 13:47
Allow a breakpoint to suspend only after a configured dependency
breakpoint has been hit. Dependency breakpoints can optionally continue
execution on their first hit and enable dependent breakpoints
afterwards.
@SougandhS
SougandhS force-pushed the WaitingForBreakpoint branch from 83b4ab2 to bcd0916 Compare August 30, 2026 14:10
@SougandhS

Copy link
Copy Markdown
Member Author

Hi @iloveeclipse, can you re-trigger co-pilot ?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Suppressed comments (3)

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

  • The shared hasHit bit is cleared by the first waiting breakpoint that observes it. Since the model explicitly permits multiple waiting breakpoints to reference one dependency, one trigger hit activates only whichever waiting breakpoint is encountered first; all other dependents see false. Track activation/consumption per waiting breakpoint (or by generation) rather than clearing global state here; the mirrored reset in the RESUME_ON_HIT branch has the same problem.
				} else if (dependent != null && dependent.hasBeenHit()) {
					dependent.setHit(false); // Resets the hit

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java:336

  • Selecting a dependency writes directly to the breakpoint model before the editor is saved. JavaBreakpointPage.performCancel() does not restore these attributes, so choosing a dependency and then cancelling the property page still persists the dependency and suspend-policy changes. Keep these choices as pending editor state and apply them from doSave(), consistent with the existing controls.
					fBreakpoint.setDependentBreakpoint(breakpoint);
					breakpoint.setDependencyBreakpoint(true);
					if (dialog.isChecked()) {
						breakpoint.setSuspendPolicy(IJavaBreakpoint.RESUME_ON_HIT);

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java:503

  • For a dependency breakpoint using RESUME_ON_HIT but not marked as a trigger point, this sets the Resume radio selected while resumeOnHit remains false, so Suspend VM is also selected. More importantly, doSave() only preserves RESUME_ON_HIT when the trigger-point checkbox is selected; merely opening this property page and pressing OK changes the dependency breakpoint to SUSPEND_VM. Treat dependency breakpoints as valid resume-on-hit users in both initialization and save logic.
			if (breakpoint.isDependencyBreakpoint() && breakpoint.getSuspendPolicy() == IJavaBreakpoint.RESUME_ON_HIT) {
				enableContinueOnHit = true;
			}
		}

Comment on lines +1539 to +1543
if (breakpoint.isDependencyBreakpoint()) {
breakpoint.setHit(true);
}
if (breakpoint.isDependencyEnabled() && breakpoint.hasDependentBreakpoint()) {
IJavaBreakpoint dependent = breakpoint.getDependentBreakpoint();
Comment on lines +1737 to +1738
protected StringBuilder appendIsDependentStatus(IJavaBreakpoint breakpoint, StringBuilder label) throws CoreException {
if (breakpoint.isDependencyBreakpoint()) {
Comment on lines +484 to +488
@Override
public void removeDependentBreakpoint() throws CoreException {
dependentBreakpoint = null;
setAttribute(DEPENDENT_BREAKPOINT, null);
}
}

private void openBreakpointSelectionDialog(Shell shell) {
IBreakpoint[] bps = Arrays.stream(DebugPlugin.getDefault().getBreakpointManager().getBreakpoints()).filter(bp -> bp instanceof IJavaBreakpoint).filter(bp -> !bp.equals(fBreakpoint)).toArray(IBreakpoint[]::new);
}
}

public void testDependencyBpWithExternalAndChainedDependancies() throws Exception {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants