Skip to content

Commit

Permalink
Try to workaround #165
Browse files Browse the repository at this point in the history
  • Loading branch information
arichardson committed Sep 13, 2021
1 parent 5ecbb12 commit 9d7c61f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion target/mips/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -32710,10 +32710,13 @@ void mips_cpu_dump_state(CPUState *cs, FILE *f, int flags)
CPUMIPSState *env = &cpu->env;
int i;

// FIXME: will this be the right pc or start of TB?
// Correct fix would be to implement tcg_cpu_synchronize_state()
target_ulong pc_addr = cpu_get_current_pc(env, 0, 0);
qemu_fprintf(f, "pc=0x" TARGET_FMT_lx " HI=0x" TARGET_FMT_lx
" LO=0x" TARGET_FMT_lx " ds %04x "
TARGET_FMT_lx " " TARGET_FMT_ld "\n",
PC_ADDR(env), env->active_tc.HI[0], env->active_tc.LO[0],
pc_addr, env->active_tc.HI[0], env->active_tc.LO[0],
env->hflags, env->btarget, env->bcond);
for (i = 0; i < 32; i++) {
if ((i & 3) == 0) {
Expand Down
5 changes: 4 additions & 1 deletion target/riscv/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
qemu_fprintf(f, " %s %d\n", "V = ", riscv_cpu_virt_enabled(env));
}
#endif
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "pc ", PC_ADDR(env));
// FIXME: will this be the right pc or start of TB?
// Correct fix would be to implement tcg_cpu_synchronize_state()
target_ulong pc_addr = cpu_get_current_pc(env, 0, 0);
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "pc ", pc_addr);
#ifdef TARGET_CHERI
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "pc (offset) ", GET_SPECIAL_REG_ARCH(env, pc, PCC));
#endif
Expand Down

0 comments on commit 9d7c61f

Please sign in to comment.