Allow turning on the debugger in the middle of a REPL session #1198
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#1198
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.
Sometimes I'm trying out some code in the REPL, and suddenly something throws for reasons unbeknownst to me. I'd like to be able to investigate that without having to quit the debugger, relaunch it with
--debugger, and type all the previous local bindings/expressions.Describe the solution you'd like
Add a
:dbgor:decommand that sets the REPL in debugger mode, much like hownix repl --debugger <args>would have, ideally with the same local bindings we currently have.Describe alternatives you've considered
Always using the repl in debugger mode (e.g. by making an alias
nix-repl=nix repl --debugger) is not a good solution, because sometimes i don't care that something throws an error or whatever.Additional context
If I remember correctly, debuggability is current done by inserting special nodes in expressions so we can step through them, but is this done at parsing time, eval time, or a secret third option? If it's either of the first two, then this feature request is basically impossible for now.
Assuming that is possible, Is this even currently doable if the expression has already thrown? I imagine the expression that error'd is cached and thus debugging it would be impossible, but can someone confirm it? if it doesn't work for expressions that have already thrown, then this is probably pretty useless :/
Hmmmm, is this actually impossible? Or do we just have to invoke a reload and recreate the evaluator or something like that? It doesn't feel as impossible to me as when I read the issue title.
I do know that the debugger is basically a separate evaluator mode so it definitely is pretty invasive and you can't do it without restarting the evaluator, but you can restart the evaluator without killing the entire process.