2002-08-20 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / sun3-nat.c
index d608d5f8fb89d7be651acfb7d7e5d14becfee780..988ed37ad06e8b6bc1bfb3a51e21be155f5914a2 100644 (file)
@@ -1,5 +1,6 @@
 /* Host-dependent code for Sun-3 for GDB, the GNU debugger.
-   Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,6 +22,7 @@
 #include "defs.h"
 #include "inferior.h"
 #include "gdbcore.h"
+#include "regcache.h"
 
 #include <sys/ptrace.h>
 #define KERNEL                 /* To get floating point reg definitions */
 static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
 
 void
-fetch_inferior_registers (regno)
-     int regno;
+fetch_inferior_registers (int regno)
 {
   struct regs inferior_registers;
   struct fp_status inferior_fp_registers;
 
   registers_fetched ();
 
-  ptrace (PTRACE_GETREGS, inferior_pid,
+  ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
          (PTRACE_ARG3_TYPE) & inferior_registers);
 
   if (FP0_REGNUM >= 0)
-    ptrace (PTRACE_GETFPREGS, inferior_pid,
+    ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
            (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 
   memcpy (registers, &inferior_registers, 16 * 4);
@@ -63,8 +64,7 @@ fetch_inferior_registers (regno)
    Otherwise, REGNO specifies which register (so we can save time).  */
 
 void
-store_inferior_registers (regno)
-     int regno;
+store_inferior_registers (int regno)
 {
   struct regs inferior_registers;
   struct fp_status inferior_fp_registers;
@@ -83,23 +83,31 @@ store_inferior_registers (regno)
            sizeof inferior_fp_registers - 
            sizeof inferior_fp_registers.fps_regs);
 
-  ptrace (PTRACE_SETREGS, inferior_pid,
+  ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
          (PTRACE_ARG3_TYPE) & inferior_registers);
   if (FP0_REGNUM >= 0)
-    ptrace (PTRACE_SETFPREGS, inferior_pid,
+    ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
            (PTRACE_ARG3_TYPE) & inferior_fp_registers);
 }
 
 
 /* All of this stuff is only relevant if both host and target are sun3.  */
-/* Machine-dependent code for pulling registers out of a Sun-3 core file. */
+
+/* Provide registers to GDB from a core file.
+
+   CORE_REG_SECT points to an array of bytes, which were obtained from
+   a core file which BFD thinks might contain register contents. 
+   CORE_REG_SIZE is its size.
+
+   WHICH says which register set corelow suspects this is:
+     0 --- the general-purpose register set
+     2 --- the floating-point register set
+
+   REG_ADDR isn't used.  */
 
 static void
-fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
-     char *core_reg_sect;
-     unsigned core_reg_size;
-     int which;
-     CORE_ADDR reg_addr;       /* Unused in this version */
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+                     int which, CORE_ADDR reg_addr)
 {
   struct regs *regs = (struct regs *) core_reg_sect;
 
@@ -151,7 +159,7 @@ static struct core_fns sun3_core_fns =
 };
 
 void
-_initialize_core_sun3 ()
+_initialize_core_sun3 (void)
 {
   add_core_fns (&sun3_core_fns);
 }
This page took 0.036687 seconds and 4 git commands to generate.