Skip to content

fix(debugger): Step Out no longer stops mid-epilogue on its own RETURN record - #22

Open
geircodes wants to merge 1 commit into
ClarionLive:mainfrom
geircodes:fix/step-out-epilogue-premature-stop
Open

fix(debugger): Step Out no longer stops mid-epilogue on its own RETURN record#22
geircodes wants to merge 1 commit into
ClarionLive:mainfrom
geircodes:fix/step-out-epilogue-premature-stop

Conversation

@geircodes

Copy link
Copy Markdown

A Clarion procedure's frame teardown (mov esp,ebp / pop ebp / ret) is several instructions all mapped to the SAME RETURN-statement record. The old stop condition for StepMode.Out (esp > _startEsp && gap <= OUT_GAP_MAX) only checked that esp had grown past the start — the first epilogue instruction alone already satisfies that, before the actual ret has run. Result: pressing Step Out from (or near) a procedure's own RETURN/END line repeatedly re-stops on that same procedure's epilogue instead of reaching the caller; you have to fall back to a plain Step to actually leave.

Fix: Out now also requires newStatement (leaving the starting record) — the same guard Into/Over already use.

Verified live: set a breakpoint on a RETURN line, pressed Step Out repeatedly — before the fix it stopped again on the same line every time; after, it goes straight to the caller's next statement.

…N record

A Clarion procedure's frame teardown (mov esp,ebp / pop ebp / ret) is several
instructions all mapped to the SAME RETURN-statement record, and the esp
growth from the first of them alone was enough to satisfy Out's old stop
condition before the actual `ret` had run — causing Step Out to stop
repeatedly on its own epilogue instead of reaching the caller. Out now also
requires newStatement (leaving the starting record), the same guard
Into/Over already use.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant