Skip to content

Debugger cannot get locals in some instances #8827

@lf-

Description

@lf-

cc @DieracDelta this was the bug I was talking about

Describe the bug

The debugger sometimes doesn't have locals. This can be quite frustrating and it is a major reason I don't reach for the debugger as much as I'd like to.

Steps To Reproduce

bug.nix:

let r = [];
x = builtins.throw r;
in x
$ nix eval --debugger -f bug.nix
error: cannot coerce a list to a string

       at /home/jade/dev/nixpkgs/bug.nix:2:5:

            1| let r = [];
            2| x = builtins.throw r;
             |     ^
            3| in x


Starting REPL to allow you to inspect the current state of the evaluator.

Welcome to Nix 2.13.3. Type :? for help.

nix-repl> r
error: undefined variable 'r'

       at «string»:1:1:

            1| r
             | ^

nix-repl> :env
Env level 0
builtins true false null scopedImport import isNull break abort throw derivationStrict placeholder baseNameOf dirOf removeAttrs map toString fetchMercurial fetchTree
 fetchTarball fetchGit fromTOML derivation 

Expected behavior

I should be able to get the value of r

nix-env --version output

nix-env (Nix) 2.13.3

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions