2005-01-27 Andrew Cagney <cagney@gnu.org>
[external/binutils.git] / gdb / symfile-mem.c
index 29ef926..61c168e 100644 (file)
@@ -48,6 +48,7 @@
 #include "symtab.h"
 #include "gdbcore.h"
 #include "objfiles.h"
+#include "exceptions.h"
 #include "gdbcmd.h"
 #include "target.h"
 #include "value.h"
 #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
@@ -77,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.");
 
@@ -203,7 +213,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
         typed "run" at the TTY.  */
       args.from_tty = 0;
       catch_exceptions (uiout, symbol_file_add_from_memory_wrapper,
-                       &args, NULL, RETURN_MASK_ALL);
+                       &args, RETURN_MASK_ALL);
     }
 }