2003-11-10 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Mon, 10 Nov 2003 21:20:44 +0000 (21:20 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 10 Nov 2003 21:20:44 +0000 (21:20 +0000)
* target.h (struct target_ops): Order xfer buffer parameters "read
write" not "write read".
* bfd-target.c (target_bfd_xfer_partial): Update.
* remote.c (remote_xfer_partial): Update.
* inftarg.c (child_xfer_partial): Update.
* target.c (default_xfer_partial): Update.
(target_read_partial, target_write_partial): Update.
(debug_to_xfer_partial): Update.

gdb/ChangeLog
gdb/bfd-target.c
gdb/inftarg.c
gdb/remote.c
gdb/target.c
gdb/target.h

index 4b57c78e58f1f883229f416be5df9faa291779f4..04a0bb88d54a8797ab5e0897e8812682048a47f8 100644 (file)
@@ -1,5 +1,14 @@
 2003-11-10  Andrew Cagney  <cagney@redhat.com>
 
+       * target.h (struct target_ops): Order xfer buffer parameters "read
+       write" not "write read".
+       * bfd-target.c (target_bfd_xfer_partial): Update.
+       * remote.c (remote_xfer_partial): Update.
+       * inftarg.c (child_xfer_partial): Update.
+       * target.c (default_xfer_partial): Update.
+       (target_read_partial, target_write_partial): Update.
+       (debug_to_xfer_partial): Update.
+
        * arch-utils.h, arch-utils.c: Fix typo in comment.
 
        * arch-utils.c (deprecated_select_gdbarch_hack): Delete function.
index 39cc73f5a91c0f34ec7c9e2ae5e67d219952aa78..ee16d85f52adcc9ecea1231271a09b90b332b38e 100644 (file)
@@ -71,8 +71,8 @@ build_target_sections_from_bfd (struct target_ops *targ, struct bfd *abfd)
 LONGEST
 target_bfd_xfer_partial (struct target_ops *ops,
                         enum target_object object,
-                        const char *annex, const void *writebuf, 
-                        void *readbuf, ULONGEST offset, LONGEST len)
+                        const char *annex, void *readbuf,
+                        const void *writebuf, ULONGEST offset, LONGEST len)
 {
   switch (object)
     {
index fd02ad03cf25b51e4abea8c61e523dce0c8c256e..6829400b5925b20e4b5eb458204887167842d181 100644 (file)
@@ -556,10 +556,9 @@ child_core_file_to_sym_file (char *core)
    memory transfers, fall back to the old memory xfer functions.  */
 
 static LONGEST
-child_xfer_partial (struct target_ops *ops,
-                   enum target_object object,
-                   const char *annex, const void *writebuf,
-                   void *readbuf, ULONGEST offset, LONGEST len)
+child_xfer_partial (struct target_ops *ops, enum target_object object,
+                   const char *annex, void *readbuf,
+                   const void *writebuf, ULONGEST offset, LONGEST len)
 {
   switch (object)
     {
@@ -577,13 +576,13 @@ child_xfer_partial (struct target_ops *ops,
 #ifndef NATIVE_XFER_UNWIND_TABLE
 #define NATIVE_XFER_UNWIND_TABLE(OPS,OBJECT,ANNEX,WRITEBUF,READBUF,OFFSET,LEN) (-1)
 #endif
-      return NATIVE_XFER_UNWIND_TABLE (ops, object, annex, writebuf,
-                                      readbuf, offset, len);
+      return NATIVE_XFER_UNWIND_TABLE (ops, object, annex, readbuf, writebuf,
+                                      offset, len);
 #endif
 
 #if 0
     case TARGET_OBJECT_AUXV:
-      return native_xfer_auxv (PIDGET (inferior_ptid), writebuf, readbuf,
+      return native_xfer_auxv (PIDGET (inferior_ptid), readbuf, writebuf,
                               offset, len);
 #endif
 
index 1e464dd0bcee16d4747ef066afb38026a6767032..d6df76adb91f702dd9cde9bc26b535f16ff2d6ad 100644 (file)
@@ -5103,7 +5103,7 @@ the loaded file\n");
 
 static LONGEST
 remote_xfer_partial (struct target_ops *ops, enum target_object object,
-                    const char *annex, const void *writebuf, void *readbuf,
+                    const char *annex, void *readbuf, const void *writebuf,
                     ULONGEST offset, LONGEST len)
 {
   struct remote_state *rs = get_remote_state ();
index 93087608b2d71a167b9ee5887796e68f80dd8699..7e088b93b96ccfb0bff53f507add4c0312d94dc7 100644 (file)
@@ -75,9 +75,9 @@ static void normal_target_post_startup_inferior (ptid_t ptid);
 
 static LONGEST default_xfer_partial (struct target_ops *ops,
                                     enum target_object object,
-                                    const char *annex, const void *writebuf,
-                                    void *readbuf, ULONGEST offset,
-                                    LONGEST len);
+                                    const char *annex, void *readbuf,
+                                    const void *writebuf,
+                                    ULONGEST offset, LONGEST len);
 
 /* Transfer LEN bytes between target address MEMADDR and GDB address
    MYADDR.  Returns 0 for success, errno code for failure (which
@@ -1074,10 +1074,9 @@ target_write_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
 /* More generic transfers.  */
 
 static LONGEST
-default_xfer_partial (struct target_ops *ops,
-                     enum target_object object,
-                     const char *annex, const void *writebuf,
-                     void *readbuf, ULONGEST offset, LONGEST len)
+default_xfer_partial (struct target_ops *ops, enum target_object object,
+                     const char *annex, void *readbuf, 
+                     const void *writebuf, ULONGEST offset, LONGEST len)
 {
   if (object == TARGET_OBJECT_MEMORY
       && ops->to_xfer_memory != NULL)
@@ -1109,7 +1108,7 @@ default_xfer_partial (struct target_ops *ops,
     }
   else if (ops->beneath != NULL)
     return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
-                                         writebuf, readbuf, offset, len);
+                                         readbuf, writebuf, offset, len);
   else
     return -1;
 }
@@ -1127,7 +1126,7 @@ target_read_partial (struct target_ops *ops,
                     ULONGEST offset, LONGEST len)
 {
   gdb_assert (ops->to_xfer_partial != NULL);
-  return ops->to_xfer_partial (ops, object, annex, NULL, buf, offset, len);
+  return ops->to_xfer_partial (ops, object, annex, buf, NULL, offset, len);
 }
 
 LONGEST
@@ -1137,7 +1136,7 @@ target_write_partial (struct target_ops *ops,
                      ULONGEST offset, LONGEST len)
 {
   gdb_assert (ops->to_xfer_partial != NULL);
-  return ops->to_xfer_partial (ops, object, annex, buf, NULL, offset, len);
+  return ops->to_xfer_partial (ops, object, annex, NULL, buf, offset, len);
 }
 
 /* Wrappers to perform the full transfer.  */
@@ -2289,20 +2288,19 @@ debug_to_stop (void)
 }
 
 static LONGEST
-debug_to_xfer_partial (struct target_ops *ops,
-                      enum target_object object,
-                      const char *annex, const void *writebuf,
-                      void *readbuf, ULONGEST offset, LONGEST len)
+debug_to_xfer_partial (struct target_ops *ops, enum target_object object,
+                      const char *annex, void *readbuf, const void *writebuf,
+                      ULONGEST offset, LONGEST len)
 {
   LONGEST retval;
 
   retval = debug_target.to_xfer_partial (&debug_target, object, annex,
-                                        writebuf, readbuf, offset, len);
+                                        readbuf, writebuf, offset, len);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_xfer_partial (%d, %s, 0x%lx,  0x%lx,  0x%s, %s) = %s\n",
                      (int) object, (annex ? annex : "(null)"),
-                     (long) writebuf, (long) readbuf, paddr_nz (offset),
+                     (long) readbuf, (long) writebuf, paddr_nz (offset),
                      paddr_d (len), paddr_d (retval));
 
   return retval;
index 4d10f02588fc87fe7dbd456bbed6d1acb3171f7b..42b9596496427f413d11afdb8538c6c80bb059b4 100644 (file)
@@ -410,9 +410,9 @@ struct target_ops
        and target_write_partial for details of each variant.  One, and
        only one, of readbuf or writebuf must be non-NULL.  */
     LONGEST (*to_xfer_partial) (struct target_ops *ops,
-                               enum target_object object,
-                               const char *annex, const void *writebuf,
-                               void *readbuf, ULONGEST offset, LONGEST len);
+                               enum target_object object, const char *annex,
+                               void *readbuf, const void *writebuf, 
+                               ULONGEST offset, LONGEST len);
 
     int to_magic;
     /* Need sub-structure for target machine related rather than comm related?