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/dcache.c | |
parent | 8992f0d7c2d63ad6b5c102572be103791c6a958e (diff) | |
download | binutils-cf7a04e8fbf324f6be2009931021fda40479f2dd.zip binutils-cf7a04e8fbf324f6be2009931021fda40479f2dd.tar.gz binutils-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/dcache.c')
-rw-r--r-- | gdb/dcache.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/gdb/dcache.c b/gdb/dcache.c index 43640b0..36c645f 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -302,19 +302,15 @@ dcache_write_line (DCACHE *dcache, struct dcache_block *db) } dirty_len = e - s; - while (dirty_len > 0) - { - res = do_xfer_memory(memaddr, myaddr, dirty_len, 1, - ®ion->attrib); - if (res <= 0) - return 0; - - memset (&db->state[XFORM(memaddr)], ENTRY_OK, res); - memaddr += res; - myaddr += res; - len -= res; - dirty_len -= res; - } + res = target_write (¤t_target, TARGET_OBJECT_RAW_MEMORY, + NULL, myaddr, memaddr, dirty_len); + if (res < dirty_len) + return 0; + + memset (&db->state[XFORM(memaddr)], ENTRY_OK, res); + memaddr += res; + myaddr += res; + len -= res; } } @@ -361,18 +357,14 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db) continue; } - while (reg_len > 0) - { - res = do_xfer_memory (memaddr, myaddr, reg_len, 0, - ®ion->attrib); - if (res <= 0) - return 0; + res = target_read (¤t_target, TARGET_OBJECT_RAW_MEMORY, + NULL, myaddr, memaddr, reg_len); + if (res < reg_len) + return 0; - memaddr += res; - myaddr += res; - len -= res; - reg_len -= res; - } + memaddr += res; + myaddr += res; + len -= res; } memset (db->state, ENTRY_OK, sizeof (db->data)); |