improved debug
This commit is contained in:
@@ -399,14 +399,14 @@ fn debug_loop(com: &mut Computer) {
|
||||
Commands::Run { desigantor } => match desigantor {
|
||||
Some(s) => match parse_int::parse::<usize>(s.as_str()) {
|
||||
Ok(addr) => {
|
||||
while com.pc != (addr / 4) {
|
||||
while com.pc != (addr / 4) && !com.error {
|
||||
com.debug_step(1);
|
||||
}
|
||||
debug_context(com);
|
||||
}
|
||||
Err(_) => match com.book.1.get(s.as_str()).cloned() {
|
||||
Some(addr) => {
|
||||
while com.pc != (addr as usize / 4) {
|
||||
while com.pc != (addr as usize / 4) && !com.error {
|
||||
com.debug_step(1);
|
||||
}
|
||||
debug_context(com);
|
||||
@@ -425,9 +425,9 @@ fn debug_loop(com: &mut Computer) {
|
||||
},
|
||||
Commands::Up => {
|
||||
let curr_sp = com.sp;
|
||||
while (com.sp < curr_sp)
|
||||
|| ((com.ram[com.pc] != (0b10001000 << 24))
|
||||
&& (com.ram[com.pc] != (0b10101000 << 24)))
|
||||
while (com.sp < curr_sp
|
||||
|| (com.ram[com.pc] != (0b10001000 << 24) && com.ram[com.pc] != (0b10101000 << 24)))
|
||||
&& !com.error
|
||||
{
|
||||
com.debug_step(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user