From 7d69eeecda86a4e30c825975c457cc6ffdc396cc Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 26 Nov 2001 16:42:11 +0000 Subject: [PATCH] * sparc-nat.c (fetch_inferior_registers): Don't rely on CORE_ADDR being 32-bit. (store_inferior_registers): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/sparc-nat.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 769e554bb1b..5828b50c065 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-11-26 Jakub Jelinek + + * sparc-nat.c (fetch_inferior_registers): Don't rely + on CORE_ADDR being 32-bit. + (store_inferior_registers): Likewise. + 2001-11-25 Eli Zaretskii * config/djgpp/config.sed: Fix an error in etc/ at "make install" diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index bb75e1f8534..f628b0eb998 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -120,15 +120,15 @@ fetch_inferior_registers (int regno) all (16 ptrace calls!) if we really need them. */ if (regno == -1) { - target_read_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)], - ®isters[REGISTER_BYTE (L0_REGNUM)], + CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)]; + target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)], 16 * REGISTER_RAW_SIZE (L0_REGNUM)); for (i = L0_REGNUM; i <= I7_REGNUM; i++) register_valid[i] = 1; } else if (regno >= L0_REGNUM && regno <= I7_REGNUM) { - CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)]; + CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)]; i = REGISTER_BYTE (regno); if (register_valid[regno]) printf_unfiltered ("register %d valid and read\n", regno); @@ -190,7 +190,7 @@ store_inferior_registers (int regno) if (wanna_store & STACK_REGS) { - CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)]; + CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)]; if (regno < 0 || regno == SP_REGNUM) { -- 2.30.2