Skip to content

Fix statement stepping skipping constant assignments - #1058

Merged
iloveeclipse merged 1 commit into
eclipse-jdt:masterfrom
iloveeclipse:issue_1053
Nov 12, 2026
Merged

iloveeclipse merged 1 commit into
eclipse-jdt:masterfrom
iloveeclipse:issue_1053

Conversation

@iloveeclipse

Copy link
Copy Markdown
Member

With statement-level stepping enabled, a line was skipped as "intermediate" if it started with a load/constant push instruction and the next line location was 1-3 bytes away. That is also true for simple statements like "result = false;" (iconst_0; istore_1), so the debugger never stopped on such assignments.

Commit 8904bd1 only handled the case where the instruction after the push is a return. Now a line is only skipped if every instruction up to the next line location is a load/constant push. Any other instruction (store, return, branch, invoke, ...) means the line is a real statement and must not be skipped.

Fixes #1053

Assisted-by: Copilot with Claude Opus 5

With statement-level stepping enabled, a line was skipped as
"intermediate" if it started with a load/constant push instruction and
the next line location was 1-3 bytes away. That is also true for simple
statements like "result = false;" (iconst_0; istore_1), so the debugger
never stopped on such assignments.

Commit 8904bd1 only handled the case
where the instruction after the push is a return. Now a line is only
skipped if every instruction up to the next line location is a
load/constant push. Any other instruction (store, return, branch,
invoke, ...) means the line is a real statement and must not be skipped.

Fixes eclipse-jdt#1053

Assisted-by: Copilot with Claude Opus 5

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.

🟢 Approval recommended

No active review issues remain for the constant-assignment stepping fix.

No open issues 🎉

What changed in this PR

Fixes statement-level stepping so the debugger stops on constant assignments instead of treating them as intermediate instructions. This extends the return-statement fix for #1053.

Changes:

  • Skip a short bytecode range only when every instruction is a load or constant push.
  • Add regression coverage for stepping into and over constant assignments.
  • Explicitly enable step filters in the return and assignment regression tests.
File Description
org.eclipse.jdt.debug/​model/​org/​eclipse/​jdt/​internal/​debug/​core/​model/​JDIThread.java Checks the entire bytecode range before skipping a location.
org.eclipse.jdt.debug.tests/​tests/​org/​eclipse/​jdt/​debug/​tests/​AbstractDebugTest.java Registers the new assignment test program.
org.eclipse.jdt.debug.tests/​tests/​org/​eclipse/​jdt/​debug/​test/​stepping/​StatementSteppingTests.java Adds assignment regression coverage and enables step filters explicitly.
org.eclipse.jdt.debug.tests/​testprograms/​StatementStepAssignment.java Provides constant assignments for the stepping regression test.

Review effort: Balanced

@iloveeclipse
iloveeclipse merged commit efe9d96 into eclipse-jdt:master Nov 12, 2026
13 checks passed
@iloveeclipse
iloveeclipse deleted the issue_1053 branch November 12, 2026 17:31
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.

Statement stepping may skip return statements

2 participants