Preliminary cleanup for splitting host/native/target.
[deliverable/binutils-gdb.git] / gdb / mach386-xdep.c
index 0b24d75722b421b0288fd8248f0eb0db5069e6f8..8f7ca166a47f3a9bc460d1b0f1f278539deebc6d 100644 (file)
@@ -17,11 +17,9 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <stdio.h>
 #include "defs.h"
 #include "frame.h"
 #include "inferior.h"
-#include "signame.h"
 #include "gdbcore.h"
 
 #if defined (GDB_TARGET_IS_MACH386)
@@ -39,9 +37,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/core.h>
+
 \f
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;                /* Original value discarded */
 {
   struct regs inferior_registers;
   struct fp_state inferior_fp_registers;
@@ -49,8 +49,10 @@ fetch_inferior_registers ()
 
   registers_fetched ();
 
-  ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers);
-  ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers);
+  ptrace (PTRACE_GETREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) &inferior_registers);
+  ptrace (PTRACE_GETFPREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
 
   bcopy (&inferior_registers, registers, sizeof inferior_registers);
 
@@ -65,6 +67,7 @@ fetch_inferior_registers ()
    If REGNO is -1, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -86,32 +89,39 @@ store_inferior_registers (regno)
        instruction that moves eax into ebp gets single-stepped.  */
     {
       int stack = inferior_registers.r_reg[SP_REGNUM];
-      int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid, stack);
+      int stuff = ptrace (PTRACE_PEEKDATA, inferior_pid,
+                         (PTRACE_ARG3_TYPE) stack);
       int reg = inferior_registers.r_reg[EAX];
       inferior_registers.r_reg[EAX] =
        inferior_registers.r_reg[FP_REGNUM];
-      ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
-      ptrace (PTRACE_POKEDATA, inferior_pid, stack, 0xc589);
-      ptrace (PTRACE_SINGLESTEP, inferior_pid, stack, 0);
+      ptrace (PTRACE_SETREGS, inferior_pid,
+             (PTRACE_ARG3_TYPE) &inferior_registers);
+      ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0xc589);
+      ptrace (PTRACE_SINGLESTEP, inferior_pid, (PTRACE_ARG3_TYPE) stack, 0);
       wait (0);
-      ptrace (PTRACE_POKEDATA, inferior_pid, stack, stuff);
+      ptrace (PTRACE_POKEDATA, inferior_pid, (PTRACE_ARG3_TYPE) stack, stuff);
       inferior_registers.r_reg[EAX] = reg;
     }
 #endif
-  ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
-  ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
+  ptrace (PTRACE_SETREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) &inferior_registers);
+  ptrace (PTRACE_SETFPREGS, inferior_pid,
+         (PTRACE_ARG3_TYPE) &inferior_fp_registers);
 }
 
 #else /* Not mach386 target.  */
 
 /* These functions shouldn't be called when we're cross-debugging.  */
 
+/* ARGSUSED */
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
 }
 
 /* ARGSUSED */
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -122,10 +132,11 @@ store_inferior_registers (regno)
 /* Work with core files, for GDB. */
 
 void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
+     unsigned int reg_addr;    /* Unused in this version */
 {
   int val;
   extern char registers[];
This page took 0.023818 seconds and 4 git commands to generate.