Add fpu register support to the gdb code, by Magnus Damm.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2817 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-05-13 16:36:24 +00:00
parent a5d251bd7e
commit 6ef99fc59c

View File

@ -657,6 +657,9 @@ static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size)
} }
} }
#elif defined (TARGET_SH4) #elif defined (TARGET_SH4)
/* Hint: Use "set architecture sh4" in GDB to see fpu registers */
static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)
{ {
uint32_t *ptr = (uint32_t *)mem_buf; uint32_t *ptr = (uint32_t *)mem_buf;
@ -676,12 +679,14 @@ static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)
SAVE (env->mach); SAVE (env->mach);
SAVE (env->macl); SAVE (env->macl);
SAVE (env->sr); SAVE (env->sr);
SAVE (0); /* TICKS */ SAVE (env->fpul);
SAVE (0); /* STALLS */ SAVE (env->fpscr);
SAVE (0); /* CYCLES */ for (i = 0; i < 16; i++)
SAVE (0); /* INSTS */ SAVE(env->fregs[i + ((env->fpscr & FPSCR_FR) ? 16 : 0)]);
SAVE (0); /* PLR */ SAVE (env->ssr);
SAVE (env->spc);
for (i = 0; i < 8; i++) SAVE(env->gregs[i]);
for (i = 0; i < 8; i++) SAVE(env->gregs[i + 16]);
return ((uint8_t *)ptr - mem_buf); return ((uint8_t *)ptr - mem_buf);
} }
@ -704,6 +709,14 @@ static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size)
LOAD (env->mach); LOAD (env->mach);
LOAD (env->macl); LOAD (env->macl);
LOAD (env->sr); LOAD (env->sr);
LOAD (env->fpul);
LOAD (env->fpscr);
for (i = 0; i < 16; i++)
LOAD(env->fregs[i + ((env->fpscr & FPSCR_FR) ? 16 : 0)]);
LOAD (env->ssr);
LOAD (env->spc);
for (i = 0; i < 8; i++) LOAD(env->gregs[i]);
for (i = 0; i < 8; i++) LOAD(env->gregs[i + 16]);
} }
#else #else
static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)