From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 6/6] Update comments to to_xfer_partial implementations.
Date: Fri, 31 Jan 2014 03:38:00 -0000 [thread overview]
Message-ID: <1391139325-2758-7-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1391139325-2758-1-git-send-email-yao@codesourcery.com>
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-01-30 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.
---
gdb/aix-thread.c | 4 +---
gdb/auxv.c | 9 +++++----
gdb/bsd-uthread.c | 5 +++--
gdb/gnu-nat.c | 3 ++-
gdb/inf-ptrace.c | 4 +---
gdb/rs6000-nat.c | 5 +----
gdb/sparc-nat.c | 3 ++-
gdb/spu-linux-nat.c | 4 +++-
8 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 4feb0cb..bd2a3a1 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1678,9 +1678,7 @@ aix_thread_store_registers (struct target_ops *ops,
}
}
-/* 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,
diff --git a/gdb/auxv.c b/gdb/auxv.c
index 50009d8..4886992 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -35,8 +35,9 @@
#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,
@@ -215,8 +216,8 @@ ld_so_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,
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 446bbd2..bf6c390 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -331,8 +331,9 @@ bsd_uthread_store_registers (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,
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index b5a8da0..efafc35 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2473,7 +2473,8 @@ out:
\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,
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 0876366..85e7e65 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -455,9 +455,7 @@ inf_ptrace_wait (struct target_ops *ops,
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,
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index dfd59d9..606da52 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -374,10 +374,7 @@ rs6000_store_inferior_registers (struct target_ops *ops,
}
}
-
-/* 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,
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index f29b4e9..a03c093 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -256,7 +256,8 @@ sparc_store_inferior_registers (struct target_ops *ops,
}
\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,
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 105529d..0127fd5 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -226,8 +226,10 @@ parse_spufs_run (int *fd, ULONGEST *addr)
}
-/* 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,
--
1.7.7.6
next prev parent reply other threads:[~2014-01-31 3:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 3:37 [PATCH 0/6] Return target_xfer_status in to_xfer_partial Yao Qi
2014-01-31 3:37 ` [PATCH 2/6] core_xfer_shared_libraries and core_xfer_shared_libraries_aix returns ULONGEST Yao Qi
2014-02-06 14:43 ` Pedro Alves
2014-02-07 4:21 ` Yao Qi
2014-01-31 3:37 ` [PATCH 1/6] Tweak in memory_error Yao Qi
2014-02-06 12:41 ` Pedro Alves
2014-02-07 4:21 ` Yao Qi
2014-01-31 3:38 ` [PATCH 4/6] Return early in target_xfer_partial when LEN is zero Yao Qi
2014-02-06 14:44 ` Pedro Alves
2014-01-31 3:38 ` [PATCH 3/6] Replace -1 with TARGET_XFER_E_IO Yao Qi
2014-02-06 14:43 ` Pedro Alves
2014-01-31 3:38 ` Yao Qi [this message]
2014-01-31 3:50 ` [PATCH 6/6] Update comments to to_xfer_partial implementations Joel Brobecker
2014-01-31 3:39 ` [PATCH 5/6] Return target_xfer_status in to_xfer_partial Yao Qi
2014-02-06 14:44 ` Pedro Alves
2014-02-07 2:11 ` Yao Qi
2014-02-11 6:35 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391139325-2758-7-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox