Skip to content

Commit

Permalink
Add v command
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Feb 4, 2025
1 parent 718158f commit 077cbb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions repl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 077cbb2

Please sign in to comment.