2004-02-12 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / amd64fbsd-nat.c
index dee2c8dea1ae8ec41a25abd87987f0656c9d4ed9..edab8b567093b4e74e9b3378f37784c9c2339362 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for FreeBSD/amd64.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -74,6 +74,8 @@ static int reg_offset[] =
   REG_OFFSET (r_r15),
   REG_OFFSET (r_rip),
   REG_OFFSET (r_rflags),
+  REG_OFFSET (r_cs),
+  REG_OFFSET (r_ss),
   -1,
   -1,
   -1,
@@ -129,7 +131,7 @@ fill_gregset (gregset_t *gregsetp, int regnum)
 void
 supply_fpregset (fpregset_t *fpregsetp)
 {
-  x86_64_supply_fxsave ((const char *) fpregsetp, -1);
+  x86_64_supply_fxsave (current_regcache, -1, fpregsetp);
 }
 
 /* Fill register REGNUM (if it is a floating-point register) in
@@ -141,84 +143,13 @@ fill_fpregset (fpregset_t *fpregsetp, int regnum)
 {
   x86_64_fill_fxsave ((char *) fpregsetp, regnum);
 }
-
-/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
-   for all registers (including the floating point registers).  */
-
-void
-fetch_inferior_registers (int regnum)
-{
-  if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
-    {
-      struct reg regs;
-
-      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-                 (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-       perror_with_name ("Couldn't get registers");
-
-      amd64_supply_native_gregset (current_regcache, &regs, -1);
-      if (regnum != -1)
-       return;
-    }
-
-  if (regnum == -1 || regnum >= FP0_REGNUM)
-    {
-      struct fpreg fpregs;
-
-      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
-                 (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't get floating point status");
-
-      x86_64_supply_fxsave ((const char *) &fpregs, -1);
-    }
-}
-
-/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
-   this for all registers (including the floating point registers).  */
-
-void
-store_inferior_registers (int regnum)
-{
-  if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
-    {
-      struct reg regs;
-
-      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-                  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-        perror_with_name ("Couldn't get registers");
-
-      amd64_collect_native_gregset (current_regcache, &regs, regnum);
-
-      if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
-                 (PTRACE_ARG3_TYPE) &regs, 0) == -1)
-        perror_with_name ("Couldn't write registers");
-
-      if (regnum != -1)
-       return;
-    }
-
-  if (regnum == -1 || regnum >= FP0_REGNUM)
-    {
-      struct fpreg fpregs;
-
-      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
-                 (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't get floating point status");
-
-      x86_64_fill_fxsave ((char *) &fpregs, regnum);
-
-      if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
-                 (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
-       perror_with_name ("Couldn't write floating point status");
-    }
-}
 \f
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64fbsd_nat (void);
 
 void
-_initialize_am64fbsd_nat (void)
+_initialize_amd64fbsd_nat (void)
 {
   int offset;
 
@@ -289,7 +220,7 @@ Please report this to <bug-gdb@gnu.org>.",
      environment can be found.  */
   {
     int mib[2];
-    int ps_strings;
+    long ps_strings;
     size_t len;
 
     mib[0] = CTL_KERN;
This page took 0.027234 seconds and 4 git commands to generate.