diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-08-15 18:46:25 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-08-15 18:46:25 +0000 |
commit | cf7a04e8fbf324f6be2009931021fda40479f2dd (patch) | |
tree | 39372f9e07462f178418ec6c91dd008f4d691bd1 /gdb/mi/mi-main.c | |
parent | 8992f0d7c2d63ad6b5c102572be103791c6a958e (diff) | |
download | gdb-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/mi/mi-main.c')
-rw-r--r-- | gdb/mi/mi-main.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index c798c90..e2e0840 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -853,16 +853,14 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc) total_bytes = word_size * nr_rows * nr_cols; mbuf = xcalloc (total_bytes, 1); make_cleanup (xfree, mbuf); - nr_bytes = 0; - while (nr_bytes < total_bytes) + + nr_bytes = target_read (¤t_target, TARGET_OBJECT_MEMORY, NULL, + mbuf, addr, total_bytes); + if (nr_bytes <= 0) { - int error; - long num = target_read_memory_partial (addr + nr_bytes, mbuf + nr_bytes, - total_bytes - nr_bytes, - &error); - if (num <= 0) - break; - nr_bytes += num; + do_cleanups (cleanups); + mi_error_message = xstrdup ("Unable to read memory."); + return MI_CMD_ERROR; } /* output the header information. */ |