(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.
+2009-11-13 Doug Evans <dje@google.com>
+
+ * 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.
+
2009-11-13 Daniel Jacobowitz <dan@codesourcery.com>
* inline-frame.c (find_inline_frame_state): Check for changed PC
}
/* If addr is present in the dcache, return the address of the block
- containing it. */
+ containing it. Otherwise return NULL. */
static struct dcache_block *
dcache_hit (DCACHE *dcache, CORE_ADDR addr)
return db;
}
-/* Fill a cache line from target memory. */
+/* Fill a cache line from target memory.
+ The result is 1 for success, 0 if the (entire) cache line
+ wasn't readable. */
static int
dcache_read_line (DCACHE *dcache, struct dcache_block *db)
return db;
}
-/* Using the data cache DCACHE return the contents of the byte at
+/* Using the data cache DCACHE, store in *PTR the contents of the byte at
address ADDR in the remote machine.
Returns 1 for success, 0 for error. */
return -1;
}
-/* Initialize the data cache. */
+/* Allocate and initialize a data cache. */
DCACHE *
dcache_init (void)
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
nonzero.
- The meaning of the result is the same as for target_write. */
+ Return the number of bytes actually transfered, or -1 if the
+ transfer is not supported or otherwise fails. Return of a non-negative
+ value less than LEN indicates that no further transfer is possible.
+ NOTE: This is different than the to_xfer_partial interface, in which
+ positive values less than LEN mean further transfers may be possible. */
int
dcache_xfer_memory (struct target_ops *ops, DCACHE *dcache,
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,
(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,
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)
{
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,
}
/* 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,
return len;
}
-
/* An alternative to target_write with progress callbacks. */
LONGEST
return len;
}
+/* For docs on target_write see target.h. */
+
LONGEST
target_write (struct target_ops *ops,
enum target_object object,