improved debuger

This commit is contained in:
Mwa
2026-03-16 19:00:59 +01:00
parent 899bb90230
commit 410c54c2f8
2 changed files with 28 additions and 0 deletions

View File

@@ -589,6 +589,15 @@ impl Computer {
}
_ => (),
}
if SHARED
.external_enabled_interupts
.load(std::sync::atomic::Ordering::Relaxed)
== 0
{
println!("Program terminated");
self.error = true;
return;
}
println!("awaiting interupt...");
}
atomic_wait::wait(&SHARED.external_interupts, 0);

View File

@@ -412,6 +412,25 @@ fn main() -> Result<(), Error> {
}
false
}
"t" | "to" => {
if next.len() >= 2 {
match parse_int::parse::<u32>(next[1]) {
Ok(v) => {
while !simulation.error && simulation.pc != (v as usize/4) {
simulation.step();
}
false
},
Err(e) => {
println!("{e}");
true
},
}
} else {
println!("{HELP_MSG}");
true
}
}
_ => {
println!("{HELP_MSG}");
true