Remove redundant test in BFD_ASSERT
[deliverable/binutils-gdb.git] / gdb / corefile.c
index d4bb3e0cc9bcf19e841fb6100654e2a137a50747..b4801d051eb21ce9e2322c56dab914afe3caa1f8 100644 (file)
@@ -73,7 +73,7 @@ core_file_command (char *filename, int from_tty)
 
   t = find_core_target ();
   if (t == NULL)
-    error ("GDB can't read core files on this machine.");
+    error (_("GDB can't read core files on this machine."));
 
   if (!filename)
     (t->to_detach) (filename, from_tty);
@@ -82,8 +82,9 @@ core_file_command (char *filename, int from_tty)
 }
 \f
 
-/* If there are two or more functions that wish to hook into exec_file_command,
- * this function will call all of the hook functions. */
+/* If there are two or more functions that wish to hook into
+   exec_file_command, this function will call all of the hook
+   functions.  */
 
 static void
 call_extra_exec_file_hooks (char *filename)
@@ -108,7 +109,7 @@ specify_exec_file_hook (void (*hook) (char *))
        * and the subsequent hooks called. */
       if (exec_file_hook_count == 0)
        {
-         /* If this is the first extra hook, initialize the hook array. */
+         /* If this is the first extra hook, initialize the hook array.  */
          exec_file_extra_hooks = (hook_type *) xmalloc (sizeof (hook_type));
          exec_file_extra_hooks[0] = deprecated_exec_file_display_hook;
          deprecated_exec_file_display_hook = call_extra_exec_file_hooks;
@@ -180,9 +181,9 @@ validate_files (void)
   if (exec_bfd && core_bfd)
     {
       if (!core_file_matches_executable_p (core_bfd, exec_bfd))
-       warning ("core file may not match specified executable file.");
+       warning (_("core file may not match specified executable file."));
       else if (bfd_get_mtime (exec_bfd) > bfd_get_mtime (core_bfd))
-       warning ("exec file is newer than core file.");
+       warning (_("exec file is newer than core file."));
     }
 }
 
@@ -198,8 +199,8 @@ get_exec_file (int err)
   if (!err)
     return NULL;
 
-  error ("No executable file specified.\n\
-Use the \"file\" or \"exec-file\" command.");
+  error (_("No executable file specified.\n\
+Use the \"file\" or \"exec-file\" command."));
   return NULL;
 }
 \f
@@ -346,11 +347,13 @@ read_memory_typed_address (CORE_ADDR addr, struct type *type)
 
 /* Same as target_write_memory, but report an error if can't write.  */
 void
-write_memory (CORE_ADDR memaddr, char *myaddr, int len)
+write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, int len)
 {
   int status;
-
-  status = target_write_memory (memaddr, myaddr, len);
+  bfd_byte *bytes = alloca (len);
+  
+  memcpy (bytes, myaddr, len);
+  status = target_write_memory (memaddr, bytes, len);
   if (status != 0)
     memory_error (status, memaddr);
 }
This page took 0.025635 seconds and 4 git commands to generate.