+/* Target objects which can be transfered using target_read,
+ target_write, et cetera. */
+
+enum target_object
+{
+ /* AVR target specific transfer. See "avr-tdep.c" and "remote.c". */
+ TARGET_OBJECT_AVR,
+ /* Transfer up-to LEN bytes of memory starting at OFFSET. */
+ TARGET_OBJECT_MEMORY,
+ /* Kernel Unwind Table. See "ia64-tdep.c". */
+ TARGET_OBJECT_UNWIND_TABLE,
+ /* Transfer auxilliary vector. */
+ TARGET_OBJECT_AUXV,
+ /* StackGhost cookie. See "sparc-tdep.c". */
+ TARGET_OBJECT_WCOOKIE
+
+ /* Possible future objects: TARGET_OBJECT_FILE, TARGET_OBJECT_PROC, ... */
+};
+
+/* Request that OPS transfer up to LEN 8-bit bytes of the target's
+ OBJECT. The OFFSET, for a seekable object, specifies the
+ starting point. The ANNEX can be used to provide additional
+ data-specific information to the target.
+
+ Return the number of bytes actually transfered, or -1 if the
+ transfer is not supported or otherwise fails. Return of a positive
+ value less than LEN indicates that no further transfer is possible.
+ Unlike the raw to_xfer_partial interface, callers of these
+ functions do not need to retry partial transfers. */
+
+extern LONGEST target_read (struct target_ops *ops,
+ enum target_object object,
+ const char *annex, gdb_byte *buf,
+ ULONGEST offset, LONGEST len);
+
+extern LONGEST target_write (struct target_ops *ops,
+ enum target_object object,
+ const char *annex, const gdb_byte *buf,
+ ULONGEST offset, LONGEST len);
+
+/* Wrapper to perform a full read of unknown size. OBJECT/ANNEX will
+ be read using OPS. The return value will be -1 if the transfer
+ fails or is not supported; 0 if the object is empty; or the length
+ of the object otherwise. If a positive value is returned, a
+ sufficiently large buffer will be allocated using xmalloc and
+ returned in *BUF_P containing the contents of the object.
+
+ This method should be used for objects sufficiently small to store
+ in a single xmalloc'd buffer, when no fixed bound on the object's
+ size is known in advance. Don't try to read TARGET_OBJECT_MEMORY
+ through this function. */
+
+extern LONGEST target_read_alloc (struct target_ops *ops,
+ enum target_object object,
+ const char *annex, gdb_byte **buf_p);
+
+/* Wrappers to target read/write that perform memory transfers. They
+ throw an error if the memory transfer fails.
+
+ NOTE: cagney/2003-10-23: The naming schema is lifted from
+ "frame.h". The parameter order is lifted from get_frame_memory,
+ which in turn lifted it from read_memory. */
+
+extern void get_target_memory (struct target_ops *ops, CORE_ADDR addr,
+ gdb_byte *buf, LONGEST len);
+extern ULONGEST get_target_memory_unsigned (struct target_ops *ops,
+ CORE_ADDR addr, int len);
+\f