* i386b-nat.c: Comment changes.
[deliverable/binutils-gdb.git] / gdb / m88k-xdep.c
index 5ecd12df306b8bad39759e252b1b2c10b018908c..9c4d1c558532978377ca448361ca647a18e5a208 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1988, 1990 Free Software Foundation, Inc.
+/* Host-dependent Motorola 88xxx support for GDB, the GNU Debugger.
+   Copyright 1988, 1990, 1991 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -16,9 +17,7 @@ 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 "param.h"
 #include "frame.h"
 #include "inferior.h"
 
@@ -66,9 +65,9 @@ extern int errno;
 extern char registers[REGISTER_BYTES];
 \f
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;                /* Original value discarded */
 {
-  register int regno;
   register unsigned int regaddr;
   char buf[MAX_REGISTER_RAW_SIZE];
   register int i;
@@ -79,7 +78,7 @@ fetch_inferior_registers ()
   offset = (char *) &u.pt_r0 - (char *) &u; 
   regaddr = offset; /* byte offset to r0;*/
 
-/*  offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR; */
+/*  offset = ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */
   for (regno = 0; regno < NUM_REGS; regno++)
     {
       /*regaddr = register_addr (regno, offset);*/
@@ -87,17 +86,21 @@ fetch_inferior_registers ()
         
       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
        {
-         *(int *) &buf[i] = ptrace (3, inferior_pid, regaddr, 0);
+         *(int *) &buf[i] = ptrace (3, inferior_pid,
+                                    (PTRACE_ARG3_TYPE) regaddr, 0);
          regaddr += sizeof (int);
        }
       supply_register (regno, buf);
     }
     /* now load up registers 36 - 38; special pc registers */
-    *(int *) &buf[0] = ptrace (3,inferior_pid,SXIP_OFFSET ,0);
+    *(int *) &buf[0] = ptrace (3,inferior_pid,
+                              (PTRACE_ARG3_TYPE) SXIP_OFFSET ,0);
     supply_register (SXIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,SNIP_OFFSET,0);
+    *(int *) &buf[0] = ptrace (3, inferior_pid,
+                              (PTRACE_ARG3_TYPE) SNIP_OFFSET,0);
     supply_register (SNIP_REGNUM, buf);
-    *(int *) &buf[0] = ptrace (3, inferior_pid,SFIP_OFFSET,0);
+    *(int *) &buf[0] = ptrace (3, inferior_pid,
+                              (PTRACE_ARG3_TYPE) SFIP_OFFSET,0);
     supply_register (SFIP_REGNUM, buf);
 }
 
@@ -105,6 +108,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;
 {
@@ -125,7 +129,8 @@ store_inferior_registers (regno)
            { 
             regaddr = offset + regno * sizeof (int);
              errno = 0;
-             ptrace (6, inferior_pid, regaddr, read_register (regno));
+             ptrace (6, inferior_pid,
+                    (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
              if (errno != 0)
               {
                 sprintf (buf, "writing register number %d", regno);
@@ -133,11 +138,14 @@ store_inferior_registers (regno)
               }
            }
        else if (regno == SXIP_REGNUM)
-             ptrace (6, inferior_pid, SXIP_OFFSET, read_register(regno));
+             ptrace (6, inferior_pid,
+                    (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register(regno));
        else if (regno == SNIP_REGNUM)
-            ptrace (6, inferior_pid, SNIP_OFFSET, read_register(regno));
+            ptrace (6, inferior_pid,
+                    (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register(regno));
        else if (regno == SFIP_REGNUM)
-            ptrace (6, inferior_pid, SFIP_OFFSET, read_register(regno));
+            ptrace (6, inferior_pid,
+                    (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register(regno));
        else printf ("Bad register number for store_inferior routine\n");
     }
   else { 
@@ -146,16 +154,20 @@ store_inferior_registers (regno)
       /*      regaddr = register_addr (regno, offset); */
               errno = 0;
               regaddr = offset + regno * sizeof (int);
-              ptrace (6, inferior_pid, regaddr, read_register (regno));
+              ptrace (6, inferior_pid,
+                     (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
               if (errno != 0)
                {
                  sprintf (buf, "writing register number %d", regno);
                  perror_with_name (buf);
                }
            }
-        ptrace (6,inferior_pid,SXIP_OFFSET,read_register(SXIP_REGNUM));
-        ptrace (6,inferior_pid,SNIP_OFFSET,read_register(SNIP_REGNUM));
-        ptrace (6,inferior_pid,SFIP_OFFSET,read_register(SFIP_REGNUM));
+        ptrace (6,inferior_pid,
+                (PTRACE_ARG3_TYPE) SXIP_OFFSET,read_register(SXIP_REGNUM));
+        ptrace (6,inferior_pid,
+                (PTRACE_ARG3_TYPE) SNIP_OFFSET,read_register(SNIP_REGNUM));
+        ptrace (6,inferior_pid,
+                (PTRACE_ARG3_TYPE) SFIP_OFFSET,read_register(SFIP_REGNUM));
        }       
            
 
@@ -266,7 +278,7 @@ core_file_command (filename, from_tty)
        corefile = savestring (filename, strlen (filename));
       else
        {
-         corefile = concat (current_directory, "/", filename);
+         corefile = concat (current_directory, "/", filename, NULL);
        }
       init_tdesc();
       current_context = init_dcontext();
This page took 0.026796 seconds and 4 git commands to generate.