libexpr: handle debug trace frames as parent pointer list

this also fixes a debugger bug where leaving the debugger does not clean
up old debugger state completely. in such cases the fake frame withFrame
created was left behind after the corresponding caller frame was unwound

Change-Id: I45adcd116276b03b2f87076518c9eae6fe844e06
This commit is contained in:
eldritch horrors
2024-11-28 15:12:22 +00:00
parent 985afeeb4d
commit 3593f5555e
7 changed files with 145 additions and 65 deletions
@@ -71,3 +71,43 @@ and resume execution
the debugger is once again disabled
nix-repl> :c
error: unknown command ':c'
leaving the debugger from a toplevel error and entering it again doesn't leave old frames visible
nix-repl> with {}; a
error: undefined variable 'a'
at «string»:1:10:
1| with {}; a
| ^
nix-repl> :s
error: undefined variable 'a'
at «string»:1:10:
1| with {}; a
| ^
nix-repl> with {}; b
error: undefined variable 'b'
at «string»:1:10:
1| with {}; b
| ^
nix-repl> :bt
0: error: undefined variable 'b'
«string»:1:10
1| with {}; b
| ^
1: error: Fake frame for debugging purposes
«string»:1:10
1| with {}; b
| ^
exiting from here prints the error
nix-repl> :q
error: undefined variable 'b'
at «string»:1:10:
1| with {}; b
| ^