From 7fe48483cd90401de2477733ce65037ee0ed0906 Mon Sep 17 00:00:00 2001 From: bellard Date: Sat, 9 Oct 2004 18:08:01 +0000 Subject: monitor fixes git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1110 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/cpu.h | 1 - target-sparc/helper.c | 2 +- target-sparc/translate.c | 36 +++++++++++++++++++----------------- 3 files changed, 20 insertions(+), 19 deletions(-) (limited to 'target-sparc') diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 03698df21f..adf8df2c9d 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -147,7 +147,6 @@ int cpu_sparc_close(CPUSPARCState *s); struct siginfo; int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc); -void cpu_sparc_dump_state(CPUSPARCState *env, FILE *f, int flags); #define TARGET_PAGE_BITS 12 /* 4k */ #include "cpu-all.h" diff --git a/target-sparc/helper.c b/target-sparc/helper.c index 63d08e77d5..93ef930fbd 100644 --- a/target-sparc/helper.c +++ b/target-sparc/helper.c @@ -290,7 +290,7 @@ void do_interrupt(int intno, int is_int, int error_code, env->pc, env->npc, env->regwptr[6]); #if 0 - cpu_sparc_dump_state(env, logfile, 0); + cpu_dump_state(env, logfile, fprintf, 0); { int i; uint8_t *ptr; diff --git a/target-sparc/translate.c b/target-sparc/translate.c index d06886c843..721a91d7f8 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -1391,44 +1391,46 @@ CPUSPARCState *cpu_sparc_init(void) #define GET_FLAG(a,b) ((env->psr & a)?b:'-') -void cpu_sparc_dump_state(CPUSPARCState * env, FILE * f, int flags) +void cpu_dump_state(CPUState *env, FILE *f, + int (*cpu_fprintf)(FILE *f, const char *fmt, ...), + int flags) { int i, x; - fprintf(f, "pc: 0x%08x npc: 0x%08x\n", (int) env->pc, (int) env->npc); - fprintf(f, "General Registers:\n"); + cpu_fprintf(f, "pc: 0x%08x npc: 0x%08x\n", (int) env->pc, (int) env->npc); + cpu_fprintf(f, "General Registers:\n"); for (i = 0; i < 4; i++) - fprintf(f, "%%g%c: 0x%08x\t", i + '0', env->gregs[i]); - fprintf(f, "\n"); + cpu_fprintf(f, "%%g%c: 0x%08x\t", i + '0', env->gregs[i]); + cpu_fprintf(f, "\n"); for (; i < 8; i++) - fprintf(f, "%%g%c: 0x%08x\t", i + '0', env->gregs[i]); - fprintf(f, "\nCurrent Register Window:\n"); + cpu_fprintf(f, "%%g%c: 0x%08x\t", i + '0', env->gregs[i]); + cpu_fprintf(f, "\nCurrent Register Window:\n"); for (x = 0; x < 3; x++) { for (i = 0; i < 4; i++) - fprintf(f, "%%%c%d: 0x%08x\t", + cpu_fprintf(f, "%%%c%d: 0x%08x\t", (x == 0 ? 'o' : (x == 1 ? 'l' : 'i')), i, env->regwptr[i + x * 8]); - fprintf(f, "\n"); + cpu_fprintf(f, "\n"); for (; i < 8; i++) - fprintf(f, "%%%c%d: 0x%08x\t", + cpu_fprintf(f, "%%%c%d: 0x%08x\t", (x == 0 ? 'o' : x == 1 ? 'l' : 'i'), i, env->regwptr[i + x * 8]); - fprintf(f, "\n"); + cpu_fprintf(f, "\n"); } - fprintf(f, "\nFloating Point Registers:\n"); + cpu_fprintf(f, "\nFloating Point Registers:\n"); for (i = 0; i < 32; i++) { if ((i & 3) == 0) - fprintf(f, "%%f%02d:", i); - fprintf(f, " %016lf", env->fpr[i]); + cpu_fprintf(f, "%%f%02d:", i); + cpu_fprintf(f, " %016lf", env->fpr[i]); if ((i & 3) == 3) - fprintf(f, "\n"); + cpu_fprintf(f, "\n"); } - fprintf(f, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n", GET_PSR(env), + cpu_fprintf(f, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n", GET_PSR(env), GET_FLAG(PSR_ZERO, 'Z'), GET_FLAG(PSR_OVF, 'V'), GET_FLAG(PSR_NEG, 'N'), GET_FLAG(PSR_CARRY, 'C'), env->psrs?'S':'-', env->psrps?'P':'-', env->psret?'E':'-', env->wim); - fprintf(f, "fsr: 0x%08x\n", env->fsr); + cpu_fprintf(f, "fsr: 0x%08x\n", env->fsr); } target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr) -- cgit v1.2.3