From 077cbb2b47234e560f7e40dd7c02b9a00b328dce Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Tue, 4 Feb 2025 00:52:10 +0000 Subject: [PATCH] Add v command --- repl/src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/repl/src/main.rs b/repl/src/main.rs index a630405..e4f9c7c 100644 --- a/repl/src/main.rs +++ b/repl/src/main.rs @@ -127,11 +127,22 @@ impl App { tracing::debug!("executing continue command"); self.debugger.r#continue().context("resuming execution")?; } + "v" => { + tracing::debug!("printing variable names in scope"); + if let Some(ProgramState { paused_frame, .. }) = &self.program_description { + for var in &paused_frame.variables { + println!(". {}", var.name); + } + } else { + println!("???"); + } + } "?" => { println!(". Commands:"); println!(". q - quit"); println!(". w - where"); println!(". c - continue"); + println!(". v - variables"); } "" => return Ok(ShouldQuit::False), other => println!("Unhandled commmand: '{}'", other),