X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fppcobsd-nat.c;h=d4cb78b24fc158543eb25ab6e83b1cda34c43e47;hb=9f1b45b0da430a7a7abf9e54acbe6f2ef9d3a763;hp=ae0deb4202b7b5af0efb65ad7004b401e7801bae;hpb=9b254dd1ce46c19dde1dde5b8d1e22e862dfacce;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/ppcobsd-nat.c b/gdb/ppcobsd-nat.c index ae0deb4202..d4cb78b24f 100644 --- a/gdb/ppcobsd-nat.c +++ b/gdb/ppcobsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for OpenBSD/powerpc. - Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2004-2014 Free Software Foundation, Inc. This file is part of GDB. @@ -45,9 +45,9 @@ /* Returns true if PT_GETFPREGS fetches this register. */ static int -getfpregs_supplies (int regnum) +getfpregs_supplies (struct gdbarch *gdbarch, int regnum) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating point registers. Traditionally, GDB's register set has still @@ -59,7 +59,7 @@ getfpregs_supplies (int regnum) It's not clear to me how best to update this code, so this assert will alert the first person to encounter the NetBSD/E500 combination to the problem. */ - gdb_assert (ppc_floating_point_unit_p (current_gdbarch)); + gdb_assert (ppc_floating_point_unit_p (gdbarch)); return ((regnum >= tdep->ppc_fp0_regnum && regnum < tdep->ppc_fp0_regnum + ppc_num_fprs) @@ -72,11 +72,12 @@ getfpregs_supplies (int regnum) for all registers. */ static void -ppcobsd_fetch_registers (struct regcache *regcache, int regnum) +ppcobsd_fetch_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) { struct reg regs; - if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), + if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -88,11 +89,12 @@ ppcobsd_fetch_registers (struct regcache *regcache, int regnum) #endif #ifdef PT_GETFPREGS - if (regnum == -1 || getfpregs_supplies (regnum)) + if (regnum == -1 + || getfpregs_supplies (get_regcache_arch (regcache), regnum)) { struct fpreg fpregs; - if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), + if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); @@ -106,11 +108,12 @@ ppcobsd_fetch_registers (struct regcache *regcache, int regnum) this for all registers. */ static void -ppcobsd_store_registers (struct regcache *regcache, int regnum) +ppcobsd_store_registers (struct target_ops *ops, + struct regcache *regcache, int regnum) { struct reg regs; - if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), + if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -121,23 +124,24 @@ ppcobsd_store_registers (struct regcache *regcache, int regnum) regnum, ®s, sizeof regs); #endif - if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), + if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't write registers")); #ifdef PT_GETFPREGS - if (regnum == -1 || getfpregs_supplies (regnum)) + if (regnum == -1 + || getfpregs_supplies (get_regcache_arch (regcache), regnum)) { struct fpreg fpregs; - if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), + if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); ppc_collect_fpregset (&ppcobsd_fpregset, regcache, regnum, &fpregs, sizeof fpregs); - if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), + if (ptrace (PT_SETFPREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't write floating point status")); }