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