Fix -Werror -Wuninitialized warnings.
[deliverable/binutils-gdb.git] / gdb / corefile.c
index 6ff1ac5fe2cf1ca51e86f290f814d0ab2e42a3ac..0d6964bd37bfb325d2cb221f8d307ce255fcd710 100644 (file)
@@ -1,5 +1,6 @@
 /* Core dump and executable file functions above target vector, for GDB.
-   Copyright 1986, 1987, 1989, 1991-1994, 2000
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
+   1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -29,6 +30,7 @@
 #include "symtab.h"
 #include "command.h"
 #include "gdbcmd.h"
+#include "symfile.h"
 #include "bfd.h"
 #include "target.h"
 #include "gdbcore.h"
@@ -37,6 +39,7 @@
 #include "gdb_stat.h"
 #include "symfile.h"
 #include "objfiles.h"
+#include "completer.h"
 
 /* Local function declarations.  */
 
@@ -90,8 +93,8 @@ core_file_command (char *filename, int from_tty)
              {
                char *symfile_copy = xstrdup (symfile);
 
-               make_cleanup (free, symfile_copy);
-               symbol_file_command (symfile_copy, from_tty);
+               make_cleanup (xfree, symfile_copy);
+               symbol_file_add_main (symfile_copy, from_tty);
              }
            else
              warning ("Unknown symbols for '%s'; use the 'symbol-file' command.", filename);
@@ -120,8 +123,7 @@ call_extra_exec_file_hooks (char *filename)
    This is called from the x-window display code.  */
 
 void
-specify_exec_file_hook (hook)
-     void (*hook) (char *);
+specify_exec_file_hook (void (*hook) (char *))
 {
   hook_type *new_array;
 
@@ -183,12 +185,14 @@ reopen_exec_file (void)
 
   /* If the timestamp of the exec file has changed, reopen it. */
   filename = xstrdup (bfd_get_filename (exec_bfd));
-  make_cleanup (free, filename);
+  make_cleanup (xfree, filename);
   mtime = bfd_get_mtime (exec_bfd);
   res = stat (filename, &st);
 
   if (mtime && mtime != st.st_mtime)
-    exec_file_command (filename, 0);
+    {
+      exec_open (filename, 0);
+    }
 #endif
 }
 \f
@@ -349,17 +353,9 @@ read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len)
    if the protocol has a less general search function, they can call this
    in the cases it can't handle.  */
 void
-generic_search (len, data, mask, startaddr, increment, lorange, hirange
-               addr_found, data_found)
-     int len;
-     char *data;
-     char *mask;
-     CORE_ADDR startaddr;
-     int increment;
-     CORE_ADDR lorange;
-     CORE_ADDR hirange;
-     CORE_ADDR *addr_found;
-     char *data_found;
+generic_search (int len, char *data, char *mask, CORE_ADDR startaddr,
+               int increment, CORE_ADDR lorange, CORE_ADDR hirange,
+               CORE_ADDR *addr_found, char *data_found)
 {
   int i;
   CORE_ADDR curaddr = startaddr;
@@ -405,7 +401,7 @@ void
 set_gnutarget (char *newtarget)
 {
   if (gnutarget_string != NULL)
-    free (gnutarget_string);
+    xfree (gnutarget_string);
   gnutarget_string = savestring (newtarget, strlen (newtarget));
   set_gnutarget_command (NULL, 0, NULL);
 }
This page took 0.024641 seconds and 4 git commands to generate.