summaryrefslogtreecommitdiff
path: root/target-sparc
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-09 18:08:01 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-09 18:08:01 +0000
commit7fe48483cd90401de2477733ce65037ee0ed0906 (patch)
tree8c3fe5c0ffda5348071a085fa82f1b5dffd9f163 /target-sparc
parent8e3a9fd28059821f819295fe9178435990141924 (diff)
downloadqemu-7fe48483cd90401de2477733ce65037ee0ed0906.tar.gz
monitor fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1110 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc')
-rw-r--r--target-sparc/cpu.h1
-rw-r--r--target-sparc/helper.c2
-rw-r--r--target-sparc/translate.c36
3 files changed, 20 insertions, 19 deletions
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)