aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile-mem.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-01-27 20:09:10 +0000
committerAndrew Cagney <cagney@redhat.com>2005-01-27 20:09:10 +0000
commit10e2d419a3084f5ed32c340cd27a94a911f694b9 (patch)
treee42bd4f1f976040659e1f6da4f1402620ad6739a /gdb/symfile-mem.c
parent89f5065b88a8015766444df05ee7bc44d7ac9192 (diff)
downloadfsf-binutils-gdb-10e2d419a3084f5ed32c340cd27a94a911f694b9.zip
fsf-binutils-gdb-10e2d419a3084f5ed32c340cd27a94a911f694b9.tar.gz
fsf-binutils-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/symfile-mem.c')
-rw-r--r--gdb/symfile-mem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index 6cb04f2..61c168e 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -58,6 +58,15 @@
#include "elf/common.h"
+/* FIXME: cagney/2005-01-27: Should be a function with the signature:
+ int (void *object, const bfd_byte *myaddr, int len). */
+
+static int
+do_target_read_memory (bfd_vma vma, char *myaddr, int len)
+{
+ return target_read_memory (vma, myaddr, len);
+}
+
/* Read inferior memory at ADDR to find the header of a loaded object file
and read its in-core symbols out of inferior memory. TEMPL is a bfd
representing the target's format. NAME is the name to use for this
@@ -78,7 +87,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
error ("add-symbol-file-from-memory not supported for this target");
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
- target_read_memory);
+ do_target_read_memory);
if (nbfd == NULL)
error ("Failed to read a valid object file image from memory.");