Get rid of corefile.c:close_exec_file
authorJoel Brobecker <brobecker@gnat.com>
Wed, 4 Jan 2012 15:13:26 +0000 (15:13 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 4 Jan 2012 15:13:26 +0000 (15:13 +0000)
The body of this function has been commented out since Jul 1999, and
thus seems unnecessary. While at it, remove some commented out code
that seems to be related to the function being deleted.

gdb/ChangeLog:

* corefile.c (close_exec_file): Delete.
(reopen_exec_file): Remove commented out code that seems related
to close_exec_file, which is being deleted here.
* inferior.h (close_exec_file): Delete.
* fork-child.c (fork_inferior): Remove call to fork_inferior.

gdb/ChangeLog
gdb/corefile.c
gdb/fork-child.c
gdb/inferior.h

index 7cb2dc767b8363ba78f894463703b97502b87e8b..042ef77aac760706106e6466f9f5c03c835073f0 100644 (file)
@@ -1,3 +1,11 @@
+2012-01-04  Joel Brobecker  <brobecker@adacore.com>
+
+       * corefile.c (close_exec_file): Delete.
+       (reopen_exec_file): Remove commented out code that seems related
+       to close_exec_file, which is being deleted here.
+       * inferior.h (close_exec_file): Delete.
+       * fork-child.c (fork_inferior): Remove call to fork_inferior.
+
 2012-01-04  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c: #include "cli/cli-utils.h".
index c07447b20913a4b61f2b5e2f0b38e44b368b467a..1741e9c40bad612497a3ad87d17e44570c00b1bf 100644 (file)
@@ -132,26 +132,9 @@ specify_exec_file_hook (void (*hook) (char *))
     deprecated_exec_file_display_hook = hook;
 }
 
-/* The exec file must be closed before running an inferior.
-   If it is needed again after the inferior dies, it must
-   be reopened.  */
-
-void
-close_exec_file (void)
-{
-#if 0                          /* FIXME */
-  if (exec_bfd)
-    bfd_tempclose (exec_bfd);
-#endif
-}
-
 void
 reopen_exec_file (void)
 {
-#if 0                          /* FIXME */
-  if (exec_bfd)
-    bfd_reopen (exec_bfd);
-#else
   char *filename;
   int res;
   struct stat st;
@@ -175,7 +158,6 @@ reopen_exec_file (void)
     bfd_cache_close_all ();
 
   do_cleanups (cleanups);
-#endif
 }
 \f
 /* If we have both a core file and an exec file,
index cba91f9b46d2a0039038e18f6d70854dff8135d2..3b8da49ef87c4abd61fb2d5c4bbd3d982e4e38be 100644 (file)
@@ -272,9 +272,6 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
       argv[3] = (char *) 0;
     }
 
-  /* On some systems an exec will fail if the executable is open.  */
-  close_exec_file ();
-
   /* Retain a copy of our environment variables, since the child will
      replace the value of environ and if we're vforked, we have to
      restore it.  */
index f9b36563ab6fcaaea1b1c18e4588b0022a6254f4..f05789f224a786b14ceead815c3e494d25cb3103 100644 (file)
@@ -154,8 +154,6 @@ extern void fetch_inferior_event (void *);
 
 extern void init_wait_for_inferior (void);
 
-extern void close_exec_file (void);
-
 extern void reopen_exec_file (void);
 
 /* The `resume' routine should only be called in special circumstances.
This page took 0.029679 seconds and 4 git commands to generate.