Commit 8979596d1785fd52badbdb177a5ef09d4f182f40
1 parent
3ccacc4a
Fix Sparc64 double float gdb protocol (initial version by Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2666 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
5 deletions
gdbstub.c
... | ... | @@ -377,9 +377,9 @@ static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) |
377 | 377 | for (i = 0; i < 64; i += 2) { |
378 | 378 | uint64_t tmp; |
379 | 379 | |
380 | - tmp = (uint64_t)tswap32(*((uint32_t *)&env->fpr[i])) << 32; | |
381 | - tmp |= tswap32(*((uint32_t *)&env->fpr[i + 1])); | |
382 | - registers[i/2 + 32] = tmp; | |
380 | + tmp = ((uint64_t)*(uint32_t *)&env->fpr[i]) << 32; | |
381 | + tmp |= *(uint32_t *)&env->fpr[i + 1]; | |
382 | + registers[i / 2 + 32] = tswap64(tmp); | |
383 | 383 | } |
384 | 384 | registers[64] = tswapl(env->pc); |
385 | 385 | registers[65] = tswapl(env->npc); |
... | ... | @@ -419,8 +419,11 @@ static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size) |
419 | 419 | env->fsr = tswapl(registers[70]); |
420 | 420 | #else |
421 | 421 | for (i = 0; i < 64; i += 2) { |
422 | - *((uint32_t *)&env->fpr[i]) = tswap32(registers[i/2 + 32] >> 32); | |
423 | - *((uint32_t *)&env->fpr[i + 1]) = tswap32(registers[i/2 + 32] & 0xffffffff); | |
422 | + uint64_t tmp; | |
423 | + | |
424 | + tmp = tswap64(registers[i / 2 + 32]); | |
425 | + *((uint32_t *)&env->fpr[i]) = tmp >> 32; | |
426 | + *((uint32_t *)&env->fpr[i + 1]) = tmp & 0xffffffff; | |
424 | 427 | } |
425 | 428 | env->pc = tswapl(registers[64]); |
426 | 429 | env->npc = tswapl(registers[65]); | ... | ... |