Skip to content

Commit

Permalink
Fix syscalls triggering multiple times when executing as fast as poss…
Browse files Browse the repository at this point in the history
…ible
  • Loading branch information
brooksmckinley committed Mar 27, 2024
1 parent df3b13b commit 0c6e4f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,10 @@ impl EmulatorCoreAgentState {
DatapathRef::MIPS(datapath) => datapath.registers.pc,
DatapathRef::RISCV(datapath) => datapath.registers.pc,
};
if self.breakpoints.contains(&current_pc) {
if self.breakpoints.contains(&current_pc) && self.updates.hit_breakpoint {
self.executing = false;
// Unset the hit_breakpoint flag after processing
self.updates.hit_breakpoint = false;
}
}

Expand Down Expand Up @@ -491,6 +493,9 @@ impl EmulatorCoreAgentState {
}
}
}

// Now that the syscall is processed, unset the update signal
self.updates.hit_syscall = false;
}

/// Determines of datapath updates should be sent. Datapath updates should be sent at most once
Expand Down Expand Up @@ -521,6 +526,7 @@ impl EmulatorCoreAgentState {
}

async fn add_message(&mut self, msg: String) {
log!("Pushed message");
self.messages.push(msg);
self.scope
.send(DatapathUpdate::System(SystemUpdate::UpdateMessages(
Expand Down

0 comments on commit 0c6e4f2

Please sign in to comment.