Skip to content

Commit

Permalink
v0.1.3 - fix crashes is n,s,g,f without run first
Browse files Browse the repository at this point in the history
  • Loading branch information
pm100 committed Jan 2, 2024
1 parent 830031b commit e86640e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "db65"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
12 changes: 12 additions & 0 deletions src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,25 @@ impl Shell {
}

Some(("go", _)) => {
if !self.debugger.run_done {
bail!("program not running");
};
let reason = self.debugger.go()?;
self.stop(reason);
}

Some(("next", _)) => {
if !self.debugger.run_done {
bail!("program not running");
};
let reason = self.debugger.next()?;
self.stop(reason);
}

Some(("step", _)) => {
if !self.debugger.run_done {
bail!("program not running");
};
let reason = self.debugger.step()?;
self.stop(reason);
}
Expand Down Expand Up @@ -254,6 +263,9 @@ impl Shell {
.enable_stack_check(*args.get_one::<bool>("stackcheck").unwrap());
}
Some(("finish", _)) => {
if !self.debugger.run_done {
bail!("program not running");
};
let reason = self.debugger.finish()?;
self.stop(reason);
}
Expand Down

0 comments on commit e86640e

Please sign in to comment.