From: Mark Kettenis Date: Sat, 21 May 2011 19:19:45 +0000 (+0000) Subject: * sparc-nat.c (sparc_fetch_inferior_registers): Explicitly supply X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=22e74ef9b59080f4cf880185ec09c483952eb74f;p=binutils-gdb.git * sparc-nat.c (sparc_fetch_inferior_registers): Explicitly supply zero as the value for %g0 in the register cache. * sparc-tdep.c (sparc32_supply_gregset): Likewise. * sparc64-tdep.c (sparc64_supply_gregset): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ff93d0b2014..ea55f7c935c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-05-21 Mark Kettenis + + * sparc-nat.c (sparc_fetch_inferior_registers): Explicitly supply + zero as the value for %g0 in the register cache. + * sparc-tdep.c (sparc32_supply_gregset): Likewise. + * sparc64-tdep.c (sparc64_supply_gregset): Likewise. + 2011-05-20 Pedro Alves * infrun.c (proceed): Set previous_inferior_ptid here. diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index 60d2989e4e2..3d936fcc8fc 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -159,7 +159,9 @@ sparc_fetch_inferior_registers (struct target_ops *ops, if (regnum == SPARC_G0_REGNUM) { - regcache_raw_supply (regcache, SPARC_G0_REGNUM, NULL); + gdb_byte zero[8] = { 0 }; + + regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero); return; } diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 1039bd8e768..84fa3b1e742 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -1618,6 +1618,7 @@ sparc32_supply_gregset (const struct sparc_gregset *gregset, int regnum, const void *gregs) { const gdb_byte *regs = gregs; + gdb_byte zero[4] = { 0 }; int i; if (regnum == SPARC32_PSR_REGNUM || regnum == -1) @@ -1637,7 +1638,7 @@ sparc32_supply_gregset (const struct sparc_gregset *gregset, regs + gregset->r_y_offset); if (regnum == SPARC_G0_REGNUM || regnum == -1) - regcache_raw_supply (regcache, SPARC_G0_REGNUM, NULL); + regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero); if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1) { diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 674d390bdb3..6efa2202a50 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -1206,6 +1206,7 @@ sparc64_supply_gregset (const struct sparc_gregset *gregset, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int sparc32 = (gdbarch_ptr_bit (gdbarch) == 32); const gdb_byte *regs = gregs; + gdb_byte zero[8] = { 0 }; int i; if (sparc32) @@ -1268,7 +1269,7 @@ sparc64_supply_gregset (const struct sparc_gregset *gregset, } if (regnum == SPARC_G0_REGNUM || regnum == -1) - regcache_raw_supply (regcache, SPARC_G0_REGNUM, NULL); + regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero); if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1) {