aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-11-13 23:26:19 +0000
committerDoug Evans <dje@google.com>2009-11-13 23:26:19 +0000
commit7f79c47ecf671587d1ef45a7b164b970607c5faf (patch)
tree2a7bcafdd3ebc4d96a0507c909ea90ad5a9a85c9 /gdb/target.c
parent2a70cca486d4f175b25db1d484c7c560d14b8216 (diff)
downloadgdb-7f79c47ecf671587d1ef45a7b164b970607c5faf.zip
gdb-7f79c47ecf671587d1ef45a7b164b970607c5faf.tar.gz
gdb-7f79c47ecf671587d1ef45a7b164b970607c5faf.tar.bz2
* dcache.c (dcache_hit, dcache_read_line): Tweak comments.
(dcache_peek_byte, dcache_init, dcache_xfer_memory): Ditto. * target.c (memory_xfer_partial): Tweak comments. (target_xfer_partial, target_write_memory): Add comment. (target_read_partial): Remove note from 2003-10-21. (target_read, target_write): Add comments.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gdb/target.c b/gdb/target.c
index fc24730..a5bf53f 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1181,8 +1181,8 @@ target_section_by_addr (struct target_ops *target, CORE_ADDR addr)
return NULL;
}
-/* Perform a partial memory transfer. The arguments and return
- value are just as for target_xfer_partial. */
+/* Perform a partial memory transfer.
+ For docs see target.h, to_xfer_partial. */
static LONGEST
memory_xfer_partial (struct target_ops *ops, enum target_object object,
@@ -1360,6 +1360,8 @@ make_show_memory_breakpoints_cleanup (int show)
(void *) (uintptr_t) current);
}
+/* For docs see target.h, to_xfer_partial. */
+
static LONGEST
target_xfer_partial (struct target_ops *ops,
enum target_object object, const char *annex,
@@ -1474,6 +1476,11 @@ target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
return EIO;
}
+/* Write LEN bytes from MYADDR to target memory at address MEMADDR.
+ Returns either 0 for success or an errno value if any error occurs.
+ If an error occurs, no guarantee is made about how much data got written.
+ Callers that can deal with partial writes should call target_write. */
+
int
target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
{
@@ -1637,11 +1644,7 @@ current_xfer_partial (struct target_ops *ops, enum target_object object,
return -1;
}
-/* Target vector read/write partial wrapper functions.
-
- NOTE: cagney/2003-10-21: I wonder if having "to_xfer_partial
- (inbuf, outbuf)", instead of separate read/write methods, make life
- easier. */
+/* Target vector read/write partial wrapper functions. */
static LONGEST
target_read_partial (struct target_ops *ops,
@@ -1662,6 +1665,9 @@ target_write_partial (struct target_ops *ops,
}
/* Wrappers to perform the full transfer. */
+
+/* For docs on target_read see target.h. */
+
LONGEST
target_read (struct target_ops *ops,
enum target_object object,
@@ -1750,7 +1756,6 @@ target_read_until_error (struct target_ops *ops,
return len;
}
-
/* An alternative to target_write with progress callbacks. */
LONGEST
@@ -1786,6 +1791,8 @@ target_write_with_progress (struct target_ops *ops,
return len;
}
+/* For docs on target_write see target.h. */
+
LONGEST
target_write (struct target_ops *ops,
enum target_object object,