X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsparc-nat.c;h=3d936fcc8fc9fec7e14aea8b0cfd65e726ea9295;hb=c2949be03bf333bd3de59dc3260762d3201f6b79;hp=f9f7ad9db2cca7e331ef5d90a5509895d0464be8;hpb=0fb0cc7590113e9b459dfcc48dc71c9d419d9580;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index f9f7ad9db2..3d936fcc8f 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for SPARC. - Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 + Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GDB. @@ -89,13 +89,13 @@ void (*sparc_collect_gregset) (const struct sparc_gregset *, const struct regcache *, int, void *); void (*sparc_supply_fpregset) (struct regcache *, int , const void *); void (*sparc_collect_fpregset) (const struct regcache *, int , void *); -int (*sparc_gregset_supplies_p) (int); -int (*sparc_fpregset_supplies_p) (int); +int (*sparc_gregset_supplies_p) (struct gdbarch *, int); +int (*sparc_fpregset_supplies_p) (struct gdbarch *, int); /* Determine whether `gregset_t' contains register REGNUM. */ int -sparc32_gregset_supplies_p (int regnum) +sparc32_gregset_supplies_p (struct gdbarch *gdbarch, int regnum) { /* Integer registers. */ if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_G7_REGNUM) @@ -117,7 +117,7 @@ sparc32_gregset_supplies_p (int regnum) /* Determine whether `fpregset_t' contains register REGNUM. */ int -sparc32_fpregset_supplies_p (int regnum) +sparc32_fpregset_supplies_p (struct gdbarch *gdbarch, int regnum) { /* Floating-point registers. */ if (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM) @@ -134,8 +134,10 @@ sparc32_fpregset_supplies_p (int regnum) for all registers (including the floating-point registers). */ void -sparc_fetch_inferior_registers (struct regcache *regcache, int regnum) +sparc_fetch_inferior_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int pid; /* NOTE: cagney/2002-12-03: This code assumes that the currently @@ -157,11 +159,13 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum) 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; } - if (regnum == -1 || sparc_gregset_supplies_p (regnum)) + if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum)) { gregset_t regs; @@ -173,7 +177,7 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum) return; } - if (regnum == -1 || sparc_fpregset_supplies_p (regnum)) + if (regnum == -1 || sparc_fpregset_supplies_p (gdbarch, regnum)) { fpregset_t fpregs; @@ -185,8 +189,10 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum) } void -sparc_store_inferior_registers (struct regcache *regcache, int regnum) +sparc_store_inferior_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); int pid; /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers @@ -195,7 +201,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum) if (pid == 0) pid = PIDGET (inferior_ptid); - if (regnum == -1 || sparc_gregset_supplies_p (regnum)) + if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum)) { gregset_t regs; @@ -221,7 +227,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum) return; } - if (regnum == -1 || sparc_fpregset_supplies_p (regnum)) + if (regnum == -1 || sparc_fpregset_supplies_p (gdbarch, regnum)) { fpregset_t fpregs, saved_fpregs;