Notify the user that evaluating a variable/expression in the debugger caused a breakpoint to be skipped #1228

Open
opened 2026-06-10 22:43:19 +00:00 by blokyk · 0 comments
Member

When debugging nix code, you often evaluate a bunch of different expressions and local variables to figure out what's going wrong. However, if one of those expressions reaches a breakpoint, it will be silently skipped and will not be accessible again (at least not for this value of the expression containing the breakpoint).

AFAIK, part of this is semi-intentional. However, it can be confusing to users why a certain breakpoint is seemingly never reached, especially beginners that don't understand the intricacies of expression caching.

Describe the solution you'd like

The more reasonable, immediately-actionnable thing to do here would be to at least warn the user that a breakpoint got skipped, and that it may not break later [because of internal details/expression caching/etc.].

The better (though still imperfect) solution would be to just not cache either just breakpoints or all expressions when in the debugger's repl. This would allow breakpoints to be hit later on like they would normally, no matter what the user did during a previous break.

Describe alternatives you've considered

We could undo the previously linked change, though I believe that without actual design around it and UX consideration, it would just be confusing for users and overall annoying (for example, think about trying to eval an attrset that contains errors, and entering the debugger halfway through printing it)

## Is your feature request related to a problem? Please describe. When debugging nix code, you often evaluate a bunch of different expressions and local variables to figure out what's going wrong. However, if one of those expressions reaches a breakpoint, it will be silently skipped and will not be accessible again (at least not for this value of the expression containing the breakpoint). AFAIK, [part of this is semi-intentional](https://github.com/NixOS/nix/pull/9920). However, it can be confusing to users why a certain breakpoint is seemingly never reached, especially beginners that don't understand the intricacies of expression caching. ## Describe the solution you'd like The more reasonable, immediately-actionnable thing to do here would be to at least _warn_ the user that a breakpoint got skipped, and that it may not break later [because of internal details/expression caching/etc.]. The better (though still imperfect) solution would be to just not cache either just breakpoints or _all_ expressions when in the debugger's repl. This would allow breakpoints to be hit later on like they would normally, no matter what the user did during a previous break. ## Describe alternatives you've considered We could undo the previously linked change, though I believe that without actual design around it and UX consideration, it would just be confusing for users and overall annoying (for example, think about trying to eval an attrset that contains errors, and entering the debugger halfway through printing it)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1228
No description provided.