PARAMS elimination.
[deliverable/binutils-gdb.git] / gdb / corefile.c
index ce897e1c243615bd57a72fb2e4173e75367791cd..c8772de4c0abcc842cb708a9f892f17e717d7682 100644 (file)
@@ -1,5 +1,5 @@
 /* Core dump and executable file functions above target vector, for GDB.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+   Copyright 1986, 1987, 1989, 1991-1994, 2000
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -40,8 +40,8 @@
 
 /* Local function declarations.  */
 
-extern void _initialize_core PARAMS ((void));
-static void call_extra_exec_file_hooks PARAMS ((char *filename));
+extern void _initialize_core (void);
+static void call_extra_exec_file_hooks (char *filename);
 
 /* You can have any number of hooks for `exec_file_command' command to call.
    If there's only one hook, it is set in exec_file_display hook.
@@ -51,7 +51,7 @@ static void call_extra_exec_file_hooks PARAMS ((char *filename));
    old code that assumed that only one hook could be set, and which called
    exec_file_display_hook directly.  */
 
-typedef void (*hook_type) PARAMS ((char *));
+typedef void (*hook_type) (char *);
 
 hook_type exec_file_display_hook;      /* the original hook */
 static hook_type *exec_file_extra_hooks;       /* array of additional hooks */
@@ -90,7 +90,7 @@ core_file_command (filename, from_tty)
            symfile = t->to_core_file_to_sym_file (filename);
            if (symfile)
              {
-               char *symfile_copy = strdup (symfile);
+               char *symfile_copy = xstrdup (symfile);
 
                make_cleanup (free, symfile_copy);
                symbol_file_command (symfile_copy, from_tty);
@@ -124,7 +124,7 @@ call_extra_exec_file_hooks (filename)
 
 void
 specify_exec_file_hook (hook)
-     void (*hook) PARAMS ((char *));
+     void (*hook) (char *);
 {
   hook_type *new_array;
 
@@ -185,7 +185,7 @@ reopen_exec_file ()
     return;
 
   /* If the timestamp of the exec file has changed, reopen it. */
-  filename = strdup (bfd_get_filename (exec_bfd));
+  filename = xstrdup (bfd_get_filename (exec_bfd));
   make_cleanup (free, filename);
   mtime = bfd_get_mtime (exec_bfd);
   res = stat (filename, &st);
@@ -236,25 +236,25 @@ memory_error (status, memaddr)
      int status;
      CORE_ADDR memaddr;
 {
+  struct ui_file *tmp_stream = mem_fileopen ();
+  make_cleanup_ui_file_delete (tmp_stream);
+
   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.  */
@@ -270,26 +270,12 @@ read_memory (memaddr, myaddr, len)
     memory_error (status, memaddr);
 }
 
-void
-read_memory_section (memaddr, myaddr, len, bfd_section)
-     CORE_ADDR memaddr;
-     char *myaddr;
-     int len;
-     asection *bfd_section;
-{
-  int status;
-  status = target_read_memory_section (memaddr, myaddr, len, bfd_section);
-  if (status != 0)
-    memory_error (status, memaddr);
-}
-
 /* Like target_read_memory, but slightly different parameters.  */
-
 int
 dis_asm_read_memory (memaddr, myaddr, len, info)
      bfd_vma memaddr;
      bfd_byte *myaddr;
-     int len;
+     unsigned int len;
      disassemble_info *info;
 {
   return target_read_memory (memaddr, (char *) myaddr, len);
@@ -430,8 +416,7 @@ char *gnutarget;
 /* Same thing, except it is "auto" not NULL for the default case.  */
 static char *gnutarget_string;
 
-static void set_gnutarget_command
-  PARAMS ((char *, int, struct cmd_list_element *));
+static void set_gnutarget_command (char *, int, struct cmd_list_element *);
 
 static void
 set_gnutarget_command (ignore, from_tty, c)
This page took 0.025705 seconds and 4 git commands to generate.