Phase 1 of the ptid_t changes.
[deliverable/binutils-gdb.git] / gdb / remote-rdp.c
index 62e10139d871a7239e44a06abf812e2cfa42d094..673e423a793483f81e760ca5ae30f221230cb518 100644 (file)
@@ -1,5 +1,6 @@
 /* Remote debugging for the ARM RDP interface.
-   Copyright 1994, 1995 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,7 +39,6 @@
 
 #include "defs.h"
 #include "inferior.h"
-#include "gdb_wait.h"
 #include "value.h"
 #include "callback.h"
 #include "command.h"
@@ -48,6 +48,7 @@
 #include "remote-utils.h"
 #include "gdb_string.h"
 #include "gdbcore.h"
+#include "regcache.h"
 
 #ifdef HAVE_TIME_H
 #include <time.h>
@@ -167,10 +168,10 @@ static int timeout = 2;
 static char *commandline = NULL;
 
 static int
-remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr,
-                                char *myaddr,
-                                int len,
-                                int write, struct target_ops *target);
+remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+                                int write, 
+                                struct mem_attrib *attrib,
+                                struct target_ops *target);
 
 
 /* Stuff for talking to the serial layer. */
@@ -472,13 +473,13 @@ send_rdp (char *template,...)
          *pi = get_byte ();
          break;
        default:
-         abort ();
+         internal_error (__FILE__, __LINE__, "failed internal consistency check");
        }
     }
   va_end (alist);
 
   if (dst != buf)
-    abort ();
+    internal_error (__FILE__, __LINE__, "failed internal consistency check");
 }
 
 
@@ -696,15 +697,9 @@ rdp_set_command_line (char *command, char *args)
    */
 
   if (commandline != NULL)
-    free (commandline);
+    xfree (commandline);
 
-  commandline = malloc (strlen (command) + strlen (args) + 2);
-  if (commandline != NULL)
-    {
-      strcpy (commandline, command);
-      strcat (commandline, " ");
-      strcat (commandline, args);
-    }
+  xasprintf (&commandline, "%s %s", command, args);
 }
 
 static void
@@ -873,7 +868,7 @@ exec_swi (int swi, argsin *args)
        char *copy = alloca (args[2].n);
        int done = callback->read (callback, args[0].n, copy, args[2].n);
        if (done > 0)
-         remote_rdp_xfer_inferior_memory (args[1].n, copy, done, 1, 0);
+         remote_rdp_xfer_inferior_memory (args[1].n, copy, done, 1, 0, 0);
        args->n = args[2].n - done;
        return 1;
       }
@@ -905,10 +900,10 @@ exec_swi (int swi, argsin *args)
              commandline[255] = '\0';
            }
          remote_rdp_xfer_inferior_memory (args[0].n,
-                                          commandline, len + 1, 1, 0);
+                                          commandline, len + 1, 1, 0, 0);
        }
       else
-       remote_rdp_xfer_inferior_memory (args[0].n, "", 1, 1, 0);
+       remote_rdp_xfer_inferior_memory (args[0].n, "", 1, 1, 0, 0);
       return 1;
 
     default:
@@ -955,6 +950,7 @@ handle_swi (void)
                                               buf,
                                               len,
                                               0,
+                                              0,
                                               0);
            }
          else
@@ -970,7 +966,7 @@ handle_swi (void)
          break;
 
        default:
-         error ("Unimplented SWI argument");
+         error ("Unimplemented SWI argument");
        }
 
       type = type >> 2;
@@ -1187,7 +1183,7 @@ remote_rdp_close (int quitting)
    to the target, or zero for no signal.  */
 
 static void
-remote_rdp_resume (int pid, int step, enum target_signal siggnal)
+remote_rdp_resume (ptid_t ptid, int step, enum target_signal siggnal)
 {
   if (step)
     rdp_step ();
@@ -1199,8 +1195,8 @@ remote_rdp_resume (int pid, int step, enum target_signal siggnal)
    or -1 in case of error; store status through argument pointer STATUS,
    just as `wait' would.  */
 
-static int
-remote_rdp_wait (int pid, struct target_waitstatus *status)
+static ptid_t
+remote_rdp_wait (ptid_t ptid, struct target_waitstatus *status)
 {
   switch (ds.rdi_stopped_status)
     {
@@ -1226,7 +1222,7 @@ remote_rdp_wait (int pid, struct target_waitstatus *status)
 #endif
     }
 
-  return inferior_pid;
+  return inferior_ptid;
 }
 
 /* Get ready to modify the registers array.  On machines which store
@@ -1249,7 +1245,9 @@ remote_rdp_prepare_to_store (void)
 
 static int
 remote_rdp_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
-                                int write, struct target_ops *target)
+                                int write, 
+                                struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+                                struct target_ops *target ATTRIBUTE_UNUSED)
 {
   /* I infer from D Taylor's code that there's a limit on the amount
      we can transfer in one chunk.. */
@@ -1350,7 +1348,7 @@ remote_rdp_create_inferior (char *exec_file, char *allargs, char **env)
   /* This gives us a chance to set up the command line */
   rdp_set_command_line (exec_file, allargs);
 
-  inferior_pid = 42;
+  inferior_ptid = pid_to_ptid (42);
   insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   /*
@@ -1435,7 +1433,6 @@ init_remote_rdp_ops (void)
   remote_rdp_ops.to_thread_alive = 0;
   remote_rdp_ops.to_stop = 0;
   remote_rdp_ops.to_pid_to_exec_file = NULL;
-  remote_rdp_ops.to_core_file_to_sym_file = NULL;
   remote_rdp_ops.to_stratum = process_stratum;
   remote_rdp_ops.DONT_USE = NULL;
   remote_rdp_ops.to_has_all_memory = 1;
This page took 0.026792 seconds and 4 git commands to generate.