Add debug variable locations tracking#17
Conversation
|
Please note that this has some commits that I will remove from the PR (like the ones that point to the local miden-vm, and some commits for porting it to miden-vm v20 needed for the assert debugging feature -- those are just leftovers from local). But, when using https://github.com/walnuthq/miden-vm/tree/feature/debug-variable-locations-v0.19.1 and 0xMiden/compiler#820, it is able to print real values during debugging session! Test the |
|
Part of it ready for review at: #18 |
b960a98 to
e850d05
Compare
|
it depends on #30. |
e850d05 to
dce8e4b
Compare
dce8e4b to
10030f3
Compare
|
note that it still depends on the local miden-vm (0xMiden/miden-vm#2955 is needed). |
Implement debug variable tracking and display in the debugger: - Add DebugVarTracker to track variables throughout execution - Add DebugVarSnapshot for variable state at specific clock cycles - Add stub types for DebugVarInfo and DebugVarLocation (pending new miden-core) - Add resolve_variable_value (currently returns None, pending new miden-core) - Add :vars/:variables/:locals commands to display current variables The vars command shows variables in format "name=value" or "name=location" if the value cannot be resolved.
Also filter compiler locals and fix light terminal rendering
10030f3 to
833f873
Compare
|
NOTE: It uses https://github.com/walnuthq/miden-vm/tree/fix/debug-var-dedup-crash -- but 0xMiden/miden-vm#2955 should be merged soon. |
833f873 to
20cf72f
Compare
Three UX/correctness fixes for the debugger session: 1. `b in <pat>` now matches procedures called via `exec` (not just `call`). CallFrame.procedure is sticky — it's set when a new frame is pushed (by FrameStart trace events from `call`) and never updated afterwards, so for Rust programs that use `exec` internally the entire run appears to stay in the first seen procedure (e.g. `init`). Extract the live procedure from the current AsmOp's context_name instead of the frame, falling back to the frame's cached procedure when no asm op is present. 2. Continue past a terminated program now shows "program has terminated — use :r to restart" instead of silently doing nothing. 3. Add `:r` and `:restart` as aliases for the existing `:reload` command so the restart workflow is discoverable. Applied to both the TUI home page and the REPL session.
20cf72f to
279bb6e
Compare
|
I think once we can migrate this to the actual VM release on crates.io, we can merge this - but we're blocked on doing so until then. |
This enables us to use
:varsin the debugger and it will print variables values.Also adds REPL mode to the debugger.