nemu: break before executing instruction
Some checks failed
Build abstract machine with nix / build-abstract-machine (push) Failing after 45s
Run CTests within npc / npc-test (push) Failing after 47s

This commit is contained in:
xinyangli 2024-07-25 17:56:30 +08:00
parent 385d448746
commit c9ad69a32d
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk

View file

@ -158,8 +158,6 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
static Decode s; static Decode s;
nemu_state.state = NEMU_RUNNING; nemu_state.state = NEMU_RUNNING;
do { do {
exec_once(&s, cpu.pc);
g_nr_guest_inst++;
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
size_t addr = bp[i].addr; size_t addr = bp[i].addr;
bp_type_t bptype = bp[i].type; bp_type_t bptype = bp[i].type;
@ -176,6 +174,8 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
return bp + i; return bp + i;
} }
} }
exec_once(&s, cpu.pc);
g_nr_guest_inst++;
if (nemu_state.state != NEMU_RUNNING) if (nemu_state.state != NEMU_RUNNING)
return NULL; return NULL;
} while (--n); } while (--n);