diff options
author | Andrew Cagney <cagney@redhat.com> | 2005-01-27 20:09:10 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2005-01-27 20:09:10 +0000 |
commit | 10e2d419a3084f5ed32c340cd27a94a911f694b9 (patch) | |
tree | e42bd4f1f976040659e1f6da4f1402620ad6739a /gdb/target.c | |
parent | 89f5065b88a8015766444df05ee7bc44d7ac9192 (diff) | |
download | gdb-10e2d419a3084f5ed32c340cd27a94a911f694b9.zip gdb-10e2d419a3084f5ed32c340cd27a94a911f694b9.tar.gz gdb-10e2d419a3084f5ed32c340cd27a94a911f694b9.tar.bz2 |
2005-01-27 Andrew Cagney <cagney@gnu.org>
* symfile-mem.c (do_target_read_memory): New function.
(symbol_file_add_from_memory): Pass do_target_read_memory to
bfd_elf_bfd_from_remote_memory.
* corefile.c (write_memory): Update, make a copy of the read-only
buffer.
* target.c (target_read_memory): Update.
(target_write_memory): Update, make a copy of the read-only
buffer.
* gdbcore.h (write_memory): Change buffer type to bfd_byte, make
const.
* target.h (target_read_memory, target_write_memory): Change
buffer type to bfd_byte; for write_memory, make it const.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/target.c b/gdb/target.c index bade14c..5a050af 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -995,7 +995,7 @@ xfer_using_stratum (enum target_object object, const char *annex, deal with partial reads should call target_read_memory_partial. */ int -target_read_memory (CORE_ADDR memaddr, char *myaddr, int len) +target_read_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len) { if (target_xfer_partial_p ()) return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL, @@ -1005,13 +1005,15 @@ target_read_memory (CORE_ADDR memaddr, char *myaddr, int len) } int -target_write_memory (CORE_ADDR memaddr, char *myaddr, int len) +target_write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, int len) { + bfd_byte *bytes = alloca (len); + memcpy (bytes, myaddr, len); if (target_xfer_partial_p ()) return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL, - memaddr, len, NULL, myaddr); + memaddr, len, NULL, bytes); else - return target_xfer_memory (memaddr, myaddr, len, 1); + return target_xfer_memory (memaddr, bytes, len, 1); } #ifndef target_stopped_data_address_p |