> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.6.19 #1-NixOS SMP PREEMPT_DYNAMIC Fri Mar 1 12:35:11 UTC 2024 x86_64 GNU/Linux 16:01:23 up 5:37, 2 users, load average: 0.55, 0.39, 0.34
This commit is contained in:
parent
a9eaba1ffa
commit
2a65951bdb
1 changed files with 9 additions and 1 deletions
|
@ -125,12 +125,20 @@ void cpu_exec(uint64_t n) {
|
||||||
switch (nemu_state.state) {
|
switch (nemu_state.state) {
|
||||||
case NEMU_RUNNING: nemu_state.state = NEMU_STOP; break;
|
case NEMU_RUNNING: nemu_state.state = NEMU_STOP; break;
|
||||||
|
|
||||||
case NEMU_END: case NEMU_ABORT:
|
case NEMU_END: case NEMU_ABORT: {
|
||||||
Log("nemu: %s at pc = " FMT_WORD,
|
Log("nemu: %s at pc = " FMT_WORD,
|
||||||
(nemu_state.state == NEMU_ABORT ? ANSI_FMT("ABORT", ANSI_FG_RED) :
|
(nemu_state.state == NEMU_ABORT ? ANSI_FMT("ABORT", ANSI_FG_RED) :
|
||||||
(nemu_state.halt_ret == 0 ? ANSI_FMT("HIT GOOD TRAP", ANSI_FG_GREEN) :
|
(nemu_state.halt_ret == 0 ? ANSI_FMT("HIT GOOD TRAP", ANSI_FG_GREEN) :
|
||||||
ANSI_FMT("HIT BAD TRAP", ANSI_FG_RED))),
|
ANSI_FMT("HIT BAD TRAP", ANSI_FG_RED))),
|
||||||
nemu_state.halt_pc);
|
nemu_state.halt_pc);
|
||||||
|
#ifdef CONFIG_ITRACE
|
||||||
|
if (nemu_state.halt_ret != 0) {
|
||||||
|
for (int i = (logbuf_rear + 1) % CONFIG_ITRACE_BUFFER; i != logbuf_rear; i = (i + 1) % CONFIG_ITRACE_BUFFER) {
|
||||||
|
puts(logbuf[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// fall through
|
// fall through
|
||||||
case NEMU_QUIT: statistic();
|
case NEMU_QUIT: statistic();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue