Aim step-into-child at the children a children() call forwards - #83
Merged
Conversation
Stepping to a child from inside a module's `children();` ran the script to completion instead of stopping at the child. childStatementPositions returned a node's own children, and a `children()` call has none -- it forwards the enclosing invocation's, which live on the context, not on the node. With no target to match, the step degraded into a continue: the one statement whose entire job is to run the children was the one place a debugger could not step into them. It now reads ctx.childrenNodes for that case. Every forwarded child is returned even when an index argument (children(0), children([1:2])) will run only some -- a position that is never reached can never be stopped at, so the extra targets are inert. Found while chasing a report that step-into-child failed for a built-in child. The built-in was a red herring: cube() as a forwarded child steps fine now, and a user module failed identically before. What mattered was where the pause was, not what the child happened to be. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stepping to a child from inside a module's
children();ran the script to completion instead of stopping at the child.Cause
childStatementPositionsreturned a node's own children. Achildren()call has none — it forwards the enclosing invocation's, which live on the context, not on the node.With no target to match, the step degraded into a
continue. So the one statement whose entire job is to run the children was the one place a debugger could not step into them:It now reads
ctx.childrenNodesfor that case:Every forwarded child is returned even when an index argument (
children(0),children([1:2])) will run only some — a position that is never reached can never be stopped at, so the extra targets are inert.The reported cause was a red herring
This came from a report that step-into-child failed for a built-in child, with the plausible explanation that a builtin has no body to pause in. That was wrong, and I had briefly written it into a user-facing message before testing it.
cube()as a forwarded child steps fine now, and a user module failed identically before the fix. What mattered was where the pause was, not what the child happened to be.Verification
DebugHooksChildren.ChildrenCallForwardsItsCallersChildrenAsStepTargetsis new and negative-controlled: with thechildren()branch disabled it fails with "no statement-level stop at the children() call", and passes with it.801 C++ tests pass. Against a local build, BelfrySCAD's 653 tests and its GUI verifiers pass, and
to_childfromchildren();now lands on the child for both a user module and a builtin.🤖 Generated with Claude Code