Skip to content

Add support for statement-level Stepping#894

Merged
iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
SougandhS:IjjathyBranch
Mar 17, 2026
Merged

Add support for statement-level Stepping#894
iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
SougandhS:IjjathyBranch

Conversation

@SougandhS
Copy link
Copy Markdown
Member

@SougandhS SougandhS commented Mar 5, 2026

This PR Introduces a new debug preference that allows the debugger to skip intermediate bytecode instructions when performing a Stepping operations

image


In multi-line statements (such as method calls with arguments spread across multiple lines), the debugger may normally suspend multiple times due to intermediate bytecode instructions like variable or constant loads.

With this option enabled, the debugger continues stepping over these intermediate instructions and suspends only at the next executable source statement. This results in a smoother and more intuitive stepping experience, avoiding unnecessary intermediate stops within a single logical statement..

Without enabled :

Before.mp4

With enabled :

After.mp4

Fixes : #854

What it does

How to test

Author checklist

@eclipse-jdt-bot
Copy link
Copy Markdown
Contributor

eclipse-jdt-bot commented Mar 5, 2026

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 2123e7a7d25ee91c12114c77c5cfb811116bb48d Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Thu, 5 Mar 2026 07:07:51 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
index bef1c1bbb..a85defdfb 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.25.100.qualifier
+Bundle-Version: 3.25.200.qualifier
 Bundle-ClassPath: jdimodel.jar
 Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
 Bundle-Vendor: %providerName
-- 
2.53.0

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

@SougandhS SougandhS force-pushed the IjjathyBranch branch 5 times, most recently from 99a1258 to dcb5846 Compare March 5, 2026 10:45
@SougandhS
Copy link
Copy Markdown
Member Author

Hi @iloveeclipse, could you please check this PR when you get some time ?

@SougandhS SougandhS requested a review from iloveeclipse March 5, 2026 12:12
Copy link
Copy Markdown
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

In general, I find the idea great.

@SougandhS SougandhS changed the title Add support for statement-level 'Step Over' Add support for statement-level Stepping Mar 6, 2026
@SougandhS SougandhS requested a review from iloveeclipse March 6, 2026 08:56
@SougandhS SougandhS force-pushed the IjjathyBranch branch 2 times, most recently from 033f264 to 9ab4bbc Compare March 10, 2026 04:11
@iloveeclipse iloveeclipse requested a review from Copilot March 12, 2026 16:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new debugger preference to perform “statement-level stepping”, aiming to avoid suspending on intermediate bytecode instructions within a single logical (often multi-line) source statement.

Changes:

  • Adds a new IJavaDebugTarget flag (setStatementOnlyStepping / isStatementOnlyStepping) and wires it through the UI preference + options propagation.
  • Updates stepping handling in JDIThread to optionally skip intermediate bytecode locations during stepping.
  • Adds stepping tests and new test programs/snippets to validate multi-line stepping behavior.

Reviewed changes

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

Show a summary per file
File Description
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIThread.java Implements the “skip intermediate locations while stepping” behavior in step-event handling
org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIDebugTarget.java Stores the statement-only stepping flag on the target
org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaDebugTarget.java Adds new API methods for statement-only stepping flag
org.eclipse.jdt.debug/META-INF/MANIFEST.MF Bumps bundle version to 3.26.0
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugPreferencePage.java Adds preference checkbox to UI and persists it
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDebugOptionsManager.java Propagates preference value to active debug targets
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java Sets default value for the new preference
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/IJDIPreferencesConstants.java Adds preference key constant
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DebugUIMessages.properties Adds UI label string
org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DebugUIMessages.java Exposes new message key
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AutomatedSuite.java Registers the new test suite
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/AbstractDebugTest.java Registers new snippet/test program names
org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/test/stepping/StatementSteppingTests.java New stepping tests for statement-level stepping
org.eclipse.jdt.debug.tests/testprograms/StatementStepNested.java New test program for nested multi-line argument stepping
org.eclipse.jdt.debug.tests/testprograms/StatementStepArgumnt.java New test program for single multi-line argument stepping
org.eclipse.jdt.debug.tests/testprograms/StatementStep.java New test program for many multi-line arguments stepping

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

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

I haven't tested yet how it works, just did a formal code review.
There are two places where I miss explanation, and few places that should be improved.
For the later, I will push an extra commit on top in a moment, so you can easily see what I've changed.
For the unclear places, please try to make them clear :-)

@iloveeclipse
Copy link
Copy Markdown
Member

Yet another question(s): should the new preference be added to the Debug -> Step Filtering page? The page is currently only for the "Enable step filtering", so probably that would be also a good idea to add the new condition to that group, make it dependent on "enable step filtering" feature and enable both by default? Why should we hide something that is useful?

@SougandhS
Copy link
Copy Markdown
Member Author

Yet another question(s): should the new preference be added to the Debug -> Step Filtering page? The page is currently only for the "Enable step filtering", so probably that would be also a good idea to add the new condition to that group, make it dependent on "enable step filtering" feature and enable both by default? Why should we hide something that is useful?

Sure, will move this in step filtering section 👍

@SougandhS
Copy link
Copy Markdown
Member Author

Yet another question(s): should the new preference be added to the Debug -> Step Filtering page? The page is currently only for the "Enable step filtering", so probably that would be also a good idea to add the new condition to that group, make it dependent on "enable step filtering" feature and enable both by default? Why should we hide something that is useful?

Updated as suggested
image

Copy link
Copy Markdown
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

Looks good, just two small changes needed.

I will squash everything now & push, including the small fixes, and merge today.

Introduce a debug preference to enable statement-level stepping. This
allows the debugger to skip intermediate bytecode instructions in
multi-line statements and suspend only at the next executable source
statement. This avoids unnecessary stops at intermediate load
instructions during stepping.

Fixes : eclipse-jdt#854

Also-by: Andrey Loskutov <loskutov@gmx.de>
@iloveeclipse iloveeclipse merged commit ad74e77 into eclipse-jdt:master Mar 17, 2026
13 checks passed
@iloveeclipse
Copy link
Copy Markdown
Member

@SougandhS :

  1. Please provide N&N entry. Great feature.
  2. Please check if the general stepping feature can be enabled by default (see Enable step filtering options by default #914). I fear some debugger tests will need changes, but I think it is worth to enable step filtering by default.

@SougandhS
Copy link
Copy Markdown
Member Author

@SougandhS :

  1. Please provide N&N entry. Great feature.
  2. Please check if the general stepping feature can be enabled by default (see Enable step filtering options by default #914). I fear some debugger tests will need changes, but I think it is worth to enable step filtering by default.

Thank you @iloveeclipse for the review,
Will provide N&N and check #914 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

noteworthy Noteworthy feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a option to set that breakpoint on multi line row will only break once

4 participants