Skip to content

Step into the lowered frame of a top-level statement with :s - #784

Merged
aviatesk merged 1 commit into
masterfrom
avi/surface-step
Oct 3, 2026
Merged

aviatesk merged 1 commit into
masterfrom
avi/surface-step

Conversation

@aviatesk

@aviatesk aviatesk commented Oct 3, 2026

Copy link
Copy Markdown
Member

:s on a statement of a top-level driver frame, as created by Frame(mod, ex) for a :toplevel or :module expression, entered the callee of the surface call expression directly. Since the surface expression is not lowered, this failed when the call's arguments contained calls (e.g. f(g(1)) threw "unknown call f introduced by ccall lowering g"), and it skipped the rest of the statement, such as the assignment of x = f(1).

Such frames come only from Frame(mod, ex) called at the root, which debugging sessions rarely do, but #783 interprets the code passed to Core.eval in such frames, so :s inside @evaled or included code takes this path too. The two changes are independent of each other, but stepping into evaluated code with :s needs both.

Now :s enters the lowered frame of the statement like a callee, before any of the statement's side effects, and stops at its first call. As when stepping into a method, it steps through the statements before that call: global declarations, which are builtin calls on some Julia versions (Core.set_binding_type! for typed globals on 1.10-1.11, and Core.declare_global on 1.13+), :latestworld, and global loads. The handling of method frames is factored out together into maybe_step_through_prelude!. :si stops at the entry of the lowered frame.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.83%. Comparing base (5cea300) to head (e392cf1).

Files with missing lines Patch % Lines
src/utils.jl 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #784      +/-   ##
==========================================
+ Coverage   90.74%   90.83%   +0.08%     
==========================================
  Files          12       12              
  Lines        3513     3535      +22     
==========================================
+ Hits         3188     3211      +23     
+ Misses        325      324       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`:s` on a statement of a top-level driver frame, as created by
`Frame(mod, ex)` for a `:toplevel` or `:module` expression, entered the
callee of the surface call expression directly. Since the surface expression
is not lowered, this failed when the call's arguments contained calls (e.g.
`f(g(1))` threw "unknown call f introduced by ccall lowering g"), and it
skipped the rest of the statement, such as the assignment of `x = f(1)`.

Such frames come only from `Frame(mod, ex)` called at the root, which
debugging sessions rarely do, but #783
interprets the code passed to `Core.eval` in such frames, so `:s` inside
`@eval`ed or `include`d code takes this path too. The two changes are
independent of each other, but stepping into evaluated code with `:s` needs
both.

Now `:s` enters the lowered frame of the statement like a callee, before any
of the statement's side effects, and stops at its first call. As when
stepping into a method, it steps through the statements before that call:
global declarations, which are builtin calls on some Julia versions
(`Core.set_binding_type!` for typed globals on 1.10-1.11, and
`Core.declare_global` on 1.13+), `:latestworld`, and global loads. The
handling of method frames is factored out together into
`maybe_step_through_prelude!`. `:si` stops at the entry of the lowered frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aviatesk
aviatesk merged commit ff4d2f8 into master Oct 3, 2026
16 checks passed
@aviatesk
aviatesk deleted the avi/surface-step branch October 3, 2026 12:33
@aviatesk aviatesk mentioned this pull request Oct 3, 2026
aviatesk referenced this pull request Oct 3, 2026
Co-authored-by: Claude Opus 5.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