Some comments to to_xfer_partial implementations are out of date.
This patch updates them using the "Implement the to_xfer_partial
target_ops method" pattern.
gdb:
2014-02-11 Yao Qi <yao@codesourcery.com>
* aix-thread.c (aix_thread_xfer_partial): Update comments.
* auxv.c (procfs_xfer_auxv, memory_xfer_auxv): Likewise.
* bsd-uthread.c (bsd_uthread_xfer_partial): Likewise.
* gnu-nat.c (gnu_xfer_memory): Likewise.
* inf-ptrace.c (inf_ptrace_xfer_partial): Likewise.
* rs6000-nat.c (rs6000_xfer_partial): Likewise.
* sparc-nat.c (sparc_xfer_wcookie): Likewise.
* spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
+2014-02-11 Yao Qi <yao@codesourcery.com>
+
+ * aix-thread.c (aix_thread_xfer_partial): Update comments.
+ * auxv.c (procfs_xfer_auxv, memory_xfer_auxv): Likewise.
+ * bsd-uthread.c (bsd_uthread_xfer_partial): Likewise.
+ * gnu-nat.c (gnu_xfer_memory): Likewise.
+ * inf-ptrace.c (inf_ptrace_xfer_partial): Likewise.
+ * rs6000-nat.c (rs6000_xfer_partial): Likewise.
+ * sparc-nat.c (sparc_xfer_wcookie): Likewise.
+ * spu-linux-nat.c (spu_proc_xfer_spu): Likewise.
+
2014-02-11 Yao Qi <yao@codesourcery.com>
* target.h (enum target_xfer_error): Rename to ...
}
}
-/* Attempt a transfer all LEN bytes starting at OFFSET between the
- inferior's OBJECT:ANNEX space and GDB's READBUF/WRITEBUF buffer.
- Return the number of bytes actually transferred. */
+/* Implement the to_xfer_partial target_ops method. */
static enum target_xfer_status
aix_thread_xfer_partial (struct target_ops *ops, enum target_object object,
#include <fcntl.h>
-/* This function handles access via /proc/PID/auxv, which is a common
- method for native targets. */
+/* Implement the to_xfer_partial target_ops method. This function
+ handles access via /proc/PID/auxv, which is a common method for
+ native targets. */
static enum target_xfer_status
procfs_xfer_auxv (gdb_byte *readbuf,
return TARGET_XFER_OK;
}
-/* This function is called like a to_xfer_partial hook, but must be
- called with TARGET_OBJECT_AUXV. It handles access to AUXV. */
+/* Implement the to_xfer_partial target_ops method for
+ TARGET_OBJECT_AUXV. It handles access to AUXV. */
enum target_xfer_status
memory_xfer_auxv (struct target_ops *ops,
}
}
-/* FIXME: This function is only there because otherwise GDB tries to
- invoke deprecate_xfer_memory. */
+/* Implement the to_xfer_partial target_ops method. FIXME: This
+ function is only there because otherwise GDB tries to invoke
+ deprecate_xfer_memory. */
static enum target_xfer_status
bsd_uthread_xfer_partial (struct target_ops *ops, enum target_object object,
\f
-/* Helper for gnu_xfer_partial that handles memory transfers. */
+/* Implement the to_xfer_partial target_ops method for
+ TARGET_OBJECT_MEMORY. */
static enum target_xfer_status
gnu_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
return pid_to_ptid (pid);
}
-/* Attempt a transfer all LEN bytes starting at OFFSET between the
- inferior's OBJECT:ANNEX space and GDB's READBUF/WRITEBUF buffer.
- Return the number of bytes actually transferred. */
+/* Implement the to_xfer_partial target_ops method. */
static enum target_xfer_status
inf_ptrace_xfer_partial (struct target_ops *ops, enum target_object object,
}
}
-
-/* Attempt a transfer all LEN bytes starting at OFFSET between the
- inferior's OBJECT:ANNEX space and GDB's READBUF/WRITEBUF buffer.
- Return the number of bytes actually transferred. */
+/* Implement the to_xfer_partial target_ops method. */
static enum target_xfer_status
rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
}
\f
-/* Fetch StackGhost Per-Process XOR cookie. */
+/* Implement the to_xfer_partial target_ops method for
+ TARGET_OBJECT_WCOOKIE. Fetch StackGhost Per-Process XOR cookie. */
static enum target_xfer_status
sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
}
-/* Copy LEN bytes at OFFSET in spufs file ANNEX into/from READBUF or WRITEBUF,
+/* Implement the to_xfer_partial target_ops method for TARGET_OBJECT_SPU.
+ Copy LEN bytes at OFFSET in spufs file ANNEX into/from READBUF or WRITEBUF,
using the /proc file system. */
+
static enum target_xfer_status
spu_proc_xfer_spu (const char *annex, gdb_byte *readbuf,
const gdb_byte *writebuf,