Only print relevant frames with the :bt debugger command #1199
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#1199
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.
When debugging in the middle of the call stack, trying to understand the frames around you using
:btcan be a little frustrating, since you might need to scroll quite a bit to find the slice you're interested in. We could instead only print the stack around the current frame by default, with some syntax to control the range and print other parts of the stack.Describe the solution you'd like
There's multiple parts to this:
:bt, only print the frames around (e.g. 1 frame up, 1 frame down) the current one (as set by:st <n>), maybe with the non-current frames faded (i.e. withANSI_FAINT/\e[2m):bt, such that you can print more or less frames around the current one; this could be something like:bt Nfor printing N frames up (maybe with -N for down? not that useful but eh), and:bt N,Mfor printing N frames up and M frames down:bt, so you can print e.g. frames 30-25 despite being on frame 15. Not sure what the syntax should be tho... maybe:bt X Nand:bt X N,Mto print N/M frames around frameX?Describe alternatives you've considered
Additional context
One thing that goes somewhat hand-in-hand with this is shortening stack traces, either by not showing the source for everything, or by straight-up not including redundant/irrelevant frames by default (though that's tougher to determine); ideally, this behavior would be togglable with something
:bt fullor when:te/--show-traceis set. That's a separate issue, but I just want to let you know that I've considered it as well.I'd love to get feedback on this since it's mostly just a musing and none of these things are set in stone in my head.
(cc @isabelroses since i know you use the REPL and debugger; i'd particularly like to get your opinion on this)
(also cc @pennae since you're the one who thought of this :p)
I've not thought very hard about this, so definitely let's keep having some more ideas as well, but I think it's worth looking at how gdb and lldb handle bt limits. I would also maybe consider the way
list +5works in gdb where you can repeatedly hit enter to rerun the command which then gives you (iirc?) 5 more lines, relatively.