Revision e6e5906b gdbstub.c
b/gdbstub.c | ||
---|---|---|
434 | 434 |
ptr += 8 * 12 + 4; |
435 | 435 |
cpsr_write (env, tswapl(*(uint32_t *)ptr), 0xffffffff); |
436 | 436 |
} |
437 |
#elif defined (TARGET_M68K) |
|
438 |
static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) |
|
439 |
{ |
|
440 |
int i; |
|
441 |
uint8_t *ptr; |
|
442 |
CPU_DoubleU u; |
|
443 |
|
|
444 |
ptr = mem_buf; |
|
445 |
/* D0-D7 */ |
|
446 |
for (i = 0; i < 8; i++) { |
|
447 |
*(uint32_t *)ptr = tswapl(env->dregs[i]); |
|
448 |
ptr += 4; |
|
449 |
} |
|
450 |
/* A0-A7 */ |
|
451 |
for (i = 0; i < 8; i++) { |
|
452 |
*(uint32_t *)ptr = tswapl(env->aregs[i]); |
|
453 |
ptr += 4; |
|
454 |
} |
|
455 |
*(uint32_t *)ptr = tswapl(env->sr); |
|
456 |
ptr += 4; |
|
457 |
*(uint32_t *)ptr = tswapl(env->pc); |
|
458 |
ptr += 4; |
|
459 |
/* F0-F7. The 68881/68040 have 12-bit extended precision registers. |
|
460 |
ColdFire has 8-bit double precision registers. */ |
|
461 |
for (i = 0; i < 8; i++) { |
|
462 |
u.d = env->fregs[i]; |
|
463 |
*(uint32_t *)ptr = tswap32(u.l.upper); |
|
464 |
*(uint32_t *)ptr = tswap32(u.l.lower); |
|
465 |
} |
|
466 |
/* FP control regs (not implemented). */ |
|
467 |
memset (ptr, 0, 3 * 4); |
|
468 |
ptr += 3 * 4; |
|
469 |
|
|
470 |
return ptr - mem_buf; |
|
471 |
} |
|
472 |
|
|
473 |
static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size) |
|
474 |
{ |
|
475 |
int i; |
|
476 |
uint8_t *ptr; |
|
477 |
CPU_DoubleU u; |
|
478 |
|
|
479 |
ptr = mem_buf; |
|
480 |
/* D0-D7 */ |
|
481 |
for (i = 0; i < 8; i++) { |
|
482 |
env->dregs[i] = tswapl(*(uint32_t *)ptr); |
|
483 |
ptr += 4; |
|
484 |
} |
|
485 |
/* A0-A7 */ |
|
486 |
for (i = 0; i < 8; i++) { |
|
487 |
env->aregs[i] = tswapl(*(uint32_t *)ptr); |
|
488 |
ptr += 4; |
|
489 |
} |
|
490 |
env->sr = tswapl(*(uint32_t *)ptr); |
|
491 |
ptr += 4; |
|
492 |
env->pc = tswapl(*(uint32_t *)ptr); |
|
493 |
ptr += 4; |
|
494 |
/* F0-F7. The 68881/68040 have 12-bit extended precision registers. |
|
495 |
ColdFire has 8-bit double precision registers. */ |
|
496 |
for (i = 0; i < 8; i++) { |
|
497 |
u.l.upper = tswap32(*(uint32_t *)ptr); |
|
498 |
u.l.lower = tswap32(*(uint32_t *)ptr); |
|
499 |
env->fregs[i] = u.d; |
|
500 |
} |
|
501 |
/* FP control regs (not implemented). */ |
|
502 |
ptr += 3 * 4; |
|
503 |
} |
|
437 | 504 |
#elif defined (TARGET_MIPS) |
438 | 505 |
static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf) |
439 | 506 |
{ |
Also available in: Unified diff