aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-08-15 18:46:25 +0000
committerDaniel Jacobowitz <drow@false.org>2006-08-15 18:46:25 +0000
commitcf7a04e8fbf324f6be2009931021fda40479f2dd (patch)
tree39372f9e07462f178418ec6c91dd008f4d691bd1 /gdb/target.h
parent8992f0d7c2d63ad6b5c102572be103791c6a958e (diff)
downloadgdb-cf7a04e8fbf324f6be2009931021fda40479f2dd.zip
gdb-cf7a04e8fbf324f6be2009931021fda40479f2dd.tar.gz
gdb-cf7a04e8fbf324f6be2009931021fda40479f2dd.tar.bz2
PR remote/1966
* dcache.c (dcache_write_line): Use target_write. (dcache_read_line): Use target_read. * mi/mi-main.c (mi_cmd_data_read_memory): Use target_read. * symfile.c (struct load_section_data): Add new per-section members. (load_progress): New function. (load_section_callback): Pass load_progress to the new target_write_with_progress. * target.c (current_xfer_partial, memory_xfer_partial): New. (target_xfer_partial): New prototype. (target_xfer_memory, target_xfer_partial_p, xfer_using_stratum) (do_xfer_memory, target_xfer_memory_partial) (target_read_memory_partial, target_write_memory_partial): Delete. (trust_readonly): Move higher in the file. (update_current_target): Use current_xer_partial. (target_xfer_partial): Use memory_xfer_partial. Handle TARGET_OBJECT_RAW_MEMORY specially. (target_read_memory): Use target_read. (target_write_memory): Use target_write. (default_xfer_partial): Call to_xfer_partial directly. (target_write_with_progress): New function, based on target_write. (target_write): Call it. * target.h (enum target_object): Add TARGET_OBJECT_RAW_MEMORY. (target_write_with_progress): New prototype. (do_xfer_memory, target_read_memory_partial) (target_write_memory_partial): Delete prototypes.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/gdb/target.h b/gdb/target.h
index fb4361d..aa884c6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -189,6 +189,10 @@ enum target_object
TARGET_OBJECT_AVR,
/* Transfer up-to LEN bytes of memory starting at OFFSET. */
TARGET_OBJECT_MEMORY,
+ /* Memory, avoiding GDB's data cache and trusting the executable.
+ Target implementations of to_xfer_partial never need to handle
+ this object, and most callers should not use it. */
+ TARGET_OBJECT_RAW_MEMORY,
/* Kernel Unwind Table. See "ia64-tdep.c". */
TARGET_OBJECT_UNWIND_TABLE,
/* Transfer auxilliary vector. */
@@ -220,6 +224,18 @@ extern LONGEST target_write (struct target_ops *ops,
const char *annex, const gdb_byte *buf,
ULONGEST offset, LONGEST len);
+/* Similar to target_write, except that it also calls PROGRESS
+ with the number of bytes written and the opaque BATON after
+ every partial write. This is useful for progress reporting
+ and user interaction while writing data. To abort the transfer,
+ the progress callback can throw an exception. */
+LONGEST target_write_with_progress (struct target_ops *ops,
+ enum target_object object,
+ const char *annex, const gdb_byte *buf,
+ ULONGEST offset, LONGEST len,
+ void (*progress) (ULONGEST, void *),
+ void *baton);
+
/* 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
@@ -547,9 +563,6 @@ extern void target_disconnect (char *, int);
extern DCACHE *target_dcache;
-extern int do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
- int write, struct mem_attrib *attrib);
-
extern int target_read_string (CORE_ADDR, char **, int, int *);
extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
@@ -563,18 +576,6 @@ extern int xfer_memory (CORE_ADDR, gdb_byte *, int, int,
extern int child_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *, struct target_ops *);
-/* Make a single attempt at transfering LEN bytes. On a successful
- transfer, the number of bytes actually transfered is returned and
- ERR is set to 0. When a transfer fails, -1 is returned (the number
- of bytes actually transfered is not defined) and ERR is set to a
- non-zero error indication. */
-
-extern int target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
- int len, int *err);
-
-extern int target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
- int len, int *err);
-
extern char *child_pid_to_exec_file (int);
extern char *child_core_file_to_sym_file (char *);