import gdb-1999-10-04 snapshot
[deliverable/binutils-gdb.git] / gdb / corefile.c
index ce897e1c243615bd57a72fb2e4173e75367791cd..7f94c3d098795877a5da2416bfce875ce23441ca 100644 (file)
@@ -236,25 +236,27 @@ memory_error (status, memaddr)
      int status;
      CORE_ADDR memaddr;
 {
+  GDB_FILE *tmp_stream = tui_sfileopen (130);
+  make_cleanup ((make_cleanup_func) gdb_file_deallocate, &tmp_stream);
+
+  error_begin ();
+
   if (status == EIO)
     {
       /* Actually, address between memaddr and memaddr + len
          was out of bounds. */
-      error_begin ();
-      printf_filtered ("Cannot access memory at address ");
-      print_address_numeric (memaddr, 1, gdb_stdout);
-      printf_filtered (".\n");
-      return_to_top_level (RETURN_ERROR);
+      fprintf_unfiltered (tmp_stream, "Cannot access memory at address ");
+      print_address_numeric (memaddr, 1, tmp_stream);
     }
   else
     {
-      error_begin ();
-      printf_filtered ("Error accessing memory address ");
-      print_address_numeric (memaddr, 1, gdb_stdout);
-      printf_filtered (": %s.\n",
+      fprintf_filtered (tmp_stream, "Error accessing memory address ");
+      print_address_numeric (memaddr, 1, tmp_stream);
+      fprintf_filtered (tmp_stream, ": %s.",
                       safe_strerror (status));
-      return_to_top_level (RETURN_ERROR);
     }
+
+  error_stream (tmp_stream);
 }
 
 /* Same as target_read_memory, but report an error if can't read.  */
This page took 0.024955 seconds and 4 git commands to generate.