debugger: allow :st argument to be relative to current frame index #1156
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
diagnostics
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem? Please describe.
Because of nix's functional nature, debugging often involves swapping between a bunch of stack frames to trace the execution up to this point. In my experience, this involves a cycle of doing
:st <n>->:env->:p <var>-> ... ->:st <n+1>. Debugging is an activity where you already have to keep a lot of mental context constantly, and even though it might seem tiny, remember thenand incrementing it every time is a little additional mental load that quickly gets annoying and distracting.A way to go up/down a certain number of stack frames relative to the current frame would be a tiny addition that could really smooth over that friction.
Describe the solution you'd like
Since right now stack frame indices are absolute and always positive, they never require a + or - sign in front of them. We could take advantage of that by making
:st +<n>and:st -<n>indicate thatnis relative to the current frame index, while:st <n>is an absolute index. This avoids breaking any current workflow, since I can't imagine anyone would type the + sign despite not being needed.Naturally,
:st +<n>would increase the frame index (i.e. go up the stack), while:st -<n>would decrease it (i.e. going down the stack).Describe alternatives you've considered
A different command, such as
:str(stack trace relative), could be introduced, but imo that would just complicate the experience and mental model just to duplicate an existing command.Additional context
Since that change requires barely a few lines, I've already implemented it just to try to get more familiar with hacking on lix. If this is a wanted change (and the proposed design is ok), I'd be happy to submit a CL for it (though this'd be my first time using gerrit)
debugger: allowto debugger: allow:stargument to be relative:stargument to be relative to current frame indexThis issue was mentioned on Gerrit on the following CLs: